From 5ff2c6c8cc3f4045d8c1aae1ed4af5b5688fbdb7 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sun, 11 Sep 2011 23:43:13 +0200 Subject: [PATCH] Reset sound selection on click --- Sources/VLSheetViewSelection.h | 1 - Sources/VLSheetViewSelection.mm | 2 ++ Sources/VLSoundOut.cpp | 6 ++++++ Sources/VLSoundOut.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/VLSheetViewSelection.h b/Sources/VLSheetViewSelection.h index c6f13b8..7e602f1 100644 --- a/Sources/VLSheetViewSelection.h +++ b/Sources/VLSheetViewSelection.h @@ -37,7 +37,6 @@ - (void)updateMenus; - (void (^)()) willPlaySequence:(MusicSequence)music; -- (void) playWasPaused; @end diff --git a/Sources/VLSheetViewSelection.mm b/Sources/VLSheetViewSelection.mm index b21cbb9..2150a31 100644 --- a/Sources/VLSheetViewSelection.mm +++ b/Sources/VLSheetViewSelection.mm @@ -211,6 +211,8 @@ VLSequenceCallback( fSelStart = startMeas; fSelEnd = endMeas; fCursorRegion = kRegionMeasure; + + VLSoundOut::Instance()->ResetSelection(); [self updateMenus]; [self setNeedsDisplay:YES]; diff --git a/Sources/VLSoundOut.cpp b/Sources/VLSoundOut.cpp index 7581860..f3719e3 100644 --- a/Sources/VLSoundOut.cpp +++ b/Sources/VLSoundOut.cpp @@ -38,6 +38,7 @@ public: virtual bool Playing(); virtual bool AtEnd(); virtual bool AtBeginning(); + virtual void ResetSelection(); virtual void SetPlayRate(float rate); virtual void Fwd(); virtual void Bck(); @@ -395,6 +396,11 @@ bool VLAUSoundOut::AtBeginning() return MusicPlayerGetTime(fPlayer, &time) || !time; } +void VLAUSoundOut::ResetSelection() +{ + fWasAtEnd = true; +} + void VLAUSoundOut::PollMusic() { if (fRunning && AtEnd()) { diff --git a/Sources/VLSoundOut.h b/Sources/VLSoundOut.h index 1a6c773..9162adf 100644 --- a/Sources/VLSoundOut.h +++ b/Sources/VLSoundOut.h @@ -48,6 +48,7 @@ public: virtual bool Playing() = 0; virtual bool AtEnd() = 0; virtual bool AtBeginning() = 0; + virtual void ResetSelection() = 0; virtual void SetPlayRate(float rate) = 0; virtual void Fwd() = 0; virtual void Bck() = 0;