mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-01 00:19:20 +00:00
Added global hotkeys for scrubbing
This commit is contained in:
parent
54192079ed
commit
14aa38518a
@ -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() {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -72,7 +72,6 @@ namespace musik { namespace core { namespace audio {
|
||||
bool Pause();
|
||||
bool Resume();
|
||||
|
||||
double Duration();
|
||||
double Position();
|
||||
void SetPosition(double seconds);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user