diff options
Diffstat (limited to 'src/player.cc')
-rw-r--r-- | src/player.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/player.cc b/src/player.cc index d598d9f..a3eeaa2 100644 --- a/src/player.cc +++ b/src/player.cc @@ -38,7 +38,7 @@ Player::Player() pcm_data = NULL; pcm_size = 0; end = 0; - new_selection = false; + new_range = false; connect(&report_timer, SIGNAL(timeout()), this, SLOT(reportTimeout())); report_timer.start(50); // Update 25 times per second @@ -55,7 +55,7 @@ Player::~Player() #define _MIN(a, b) (a<b?a:b) void Player::run() { - Selection sel; + Range sel; static int init = 0; if(init == 0) @@ -79,14 +79,14 @@ void Player::run() while(running) { { - // Check for new Selection. + // Check for new Range. QMutexLocker lock(&mutex); - if(new_selection) + if(new_range) { - sel = selection; + sel = range; pos = sel.from; end = sel_end; - new_selection = false; + new_range = false; } } @@ -134,18 +134,18 @@ void Player::run() } } -bool Player::playSelectionDone() +bool Player::playRangeDone() { - return pos >= sel_end || pos >= selection.to; + return pos >= sel_end || pos >= range.to; } -void Player::playSelection(Selection s, int len) +void Player::playRange(Range s, int len) { { - // Enqueue new Selection for player consumation + // Enqueue new Range for player consumation QMutexLocker lock(&mutex); - selection = s; + range = s; if(len > 0) { @@ -153,16 +153,16 @@ void Player::playSelection(Selection s, int len) } else { - sel_end = selection.to - selection.from; + sel_end = range.to - range.from; } - sel_end += selection.from; + sel_end += range.from; - new_selection = true; + new_range = true; } - // Wait until player actually consumed the new Selection. - while(new_selection) + // Wait until player actually consumed the new Range. + while(new_range) { msleep(1); } @@ -197,20 +197,20 @@ void Player::setPcmData(float* data, size_t size, double samplerate) void Player::setPosition(size_t position) { - Selection s; + Range s; s.from = position; s.to = pcm_size; s.fadein = 0; s.fadeout = 0; - playSelection(s); + playRange(s); } void Player::stop() { - Selection s; + Range s; s.from = 0; s.to = 0; s.fadein = 0; s.fadeout = 0; - playSelection(s, pos); + playRange(s, pos); } |