Play right-clicked syllables when in karaoke mode

This commit is contained in:
Thomas Goyne 2012-10-16 14:08:20 -07:00
parent 4c116526d2
commit ef4cd5f519
1 changed files with 11 additions and 1 deletions

View File

@ -136,7 +136,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);
@ -362,6 +362,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(