| 1122 | } |
| 1123 | |
| 1124 | bool AudioDisplay::ForwardMouseEvent(wxMouseEvent &event) { |
| 1125 | // Handle any ongoing drag |
| 1126 | if (dragged_object && HasCapture()) |
| 1127 | { |
| 1128 | if (!dragged_object->OnMouseEvent(event)) |
| 1129 | { |
| 1130 | scroll_timer.Stop(); |
| 1131 | SetDraggedObject(nullptr); |
| 1132 | SetCursor(wxNullCursor); |
| 1133 | } |
| 1134 | return true; |
| 1135 | } |
| 1136 | else |
| 1137 | { |
| 1138 | // Something is wrong, we might have lost capture somehow. |
| 1139 | // Fix state and pretend it didn't happen. |
| 1140 | SetDraggedObject(nullptr); |
| 1141 | SetCursor(wxNullCursor); |
| 1142 | } |
| 1143 | |
| 1144 | const wxPoint mousepos = event.GetPosition(); |
| 1145 | AudioDisplayInteractionObject *new_obj = nullptr; |
| 1146 | // Check for scrollbar action |
| 1147 | if (scrollbar->GetBounds().Contains(mousepos)) |
| 1148 | { |
| 1149 | new_obj = scrollbar.get(); |
| 1150 | } |
| 1151 | // Check for timeline action |
| 1152 | else if (timeline->GetBounds().Contains(mousepos)) |
| 1153 | { |
| 1154 | SetCursor(wxCursor(wxCURSOR_SIZEWE)); |
| 1155 | new_obj = timeline.get(); |
| 1156 | } |
| 1157 | else |
| 1158 | { |
| 1159 | return false; |
| 1160 | } |
| 1161 | |
| 1162 | if (!controller->IsPlaying()) |
| 1163 | RemoveTrackCursor(); |
| 1164 | if (new_obj->OnMouseEvent(event)) |
| 1165 | SetDraggedObject(new_obj); |
| 1166 | return true; |
| 1167 | } |
| 1168 | |
| 1169 | void AudioDisplay::OnKeyDown(wxKeyEvent& event) |
| 1170 | { |
nothing calls this directly
no test coverage detected