Added global hotkeys for scrubbing

This commit is contained in:
casey 2016-05-24 00:10:36 -07:00
parent 54192079ed
commit 14aa38518a
4 changed files with 9 additions and 12 deletions

View File

@ -121,7 +121,7 @@ double Player::Position() {
void Player::SetPosition(double seconds) {
boost::mutex::scoped_lock lock(this->mutex);
this->setPosition = seconds;
this->setPosition = max(0, seconds);
}
double Player::Volume() {

View File

@ -179,16 +179,6 @@ bool Transport::Resume() {
return false;
}
double Transport::Duration() {
boost::recursive_mutex::scoped_lock lock(this->stateMutex);
if (!this->active.empty()) {
return this->active.front()->Position();
}
return 0;
}
double Transport::Position() {
boost::recursive_mutex::scoped_lock lock(this->stateMutex);

View File

@ -72,7 +72,6 @@ namespace musik { namespace core { namespace audio {
bool Pause();
bool Resume();
double Duration();
double Position();
void SetPosition(double seconds);

View File

@ -39,6 +39,14 @@ bool GlobalHotkeys::Handle(int64 ch) {
else if (kn == "ALT_L") {
this->playback.Next();
}
else if (kn == "ALT_U") {
double time = this->transport.Position();
this->transport.SetPosition(time - 10.0f);
}
else if (kn == "ALT_O") {
double time = this->transport.Position();
this->transport.SetPosition(time + 10.0f);
}
else if (kn == "^R") {
library->Indexer()->Synchronize(true);
}