Play right-clicked syllables when in karaoke mode

This commit is contained in:
Thomas Goyne 2012-10-16 14:08:20 -07:00
parent 7b3f2d0414
commit a267a15de0

View file

@ -142,7 +142,7 @@ public:
void ModifyStart(int delta);
bool IsNearbyMarker(int ms, int sensitivity) const;
std::vector<AudioMarker*> OnLeftClick(int ms, bool, int sensitivity, int);
std::vector<AudioMarker*> OnRightClick(int, bool, int, int) { return std::vector<AudioMarker*>(); }
std::vector<AudioMarker*> OnRightClick(int ms, bool, int, int);
void OnMarkerDrag(std::vector<AudioMarker*> const& marker, int new_position, int);
AudioTimingControllerKaraoke(agi::Context *c, AssKaraoke *kara, agi::signal::Connection& file_changed);
@ -368,6 +368,16 @@ std::vector<AudioMarker*> AudioTimingControllerKaraoke::OnLeftClick(int ms, bool
return std::vector<AudioMarker*>();
}
std::vector<AudioMarker*> AudioTimingControllerKaraoke::OnRightClick(int ms, bool, int, int) {
cur_syl = distance(markers.begin(), lower_bound(markers.begin(), markers.end(), ms));
AnnounceUpdatedPrimaryRange();
AnnounceUpdatedStyleRanges();
c->audioController->PlayPrimaryRange();
return std::vector<AudioMarker*>();
}
int AudioTimingControllerKaraoke::MoveMarker(KaraokeMarker *marker, int new_position) {
// No rearranging of syllables allowed
new_position = mid(