Esempio n. 1
0
def on_slider_volume_value_change(_slider, audio_engine: IAudioEngine,
                                  value: int):
    audio_engine.volume_percentage = value
Esempio n. 2
0
def on_widget_file_click(_widget, audio_engine: IAudioEngine,
                         model_index: QModelIndex):
    file_info = model_index.model().fileInfo(model_index)
    if not file_info.isDir():
        path = file_info.filePath()
        audio_engine.play(path)
Esempio n. 3
0
def on_slider_song_progress_released(_slider, audio_engine: IAudioEngine):
    audio_engine.resume()
Esempio n. 4
0
def on_slider_song_progress_value_change(_slider, audio_engine: IAudioEngine,
                                         value: int):
    audio_engine.set_song_progress_percentage(value)
Esempio n. 5
0
def on_slider_song_progress_pressed(_slider, audio_engine: IAudioEngine):
    audio_engine.pause()
Esempio n. 6
0
def on_button_volume_down_clicked(_button, audio_engine: IAudioEngine):
    audio_engine.volume_down()
Esempio n. 7
0
def on_button_volume_up_clicked(_button, audio_engine: IAudioEngine):
    audio_engine.volume_up()
Esempio n. 8
0
def on_button_loop_clicked(_button, audio_engine: IAudioEngine):
    loop_mode: LoopModes = audio_engine.loop_toggle()
    _button.setText(f"Loop: {loop_mode.name.capitalize()}")
Esempio n. 9
0
def on_button_play_pause_toggled(_button, audio_engine: IAudioEngine,
                                 is_toggled: bool):
    if is_toggled:
        audio_engine.pause()
    else:
        audio_engine.resume()