Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions abletonosc/song.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,26 @@ def song_jump_to_cue_point(song, params: Tuple[Any] = ()):
cue_point = song.cue_points[cue_point_index]
cue_point.jump()
self.osc_server.add_handler("/live/song/cue_point/jump", partial(song_jump_to_cue_point, self.song))

#--------------------------------------------------------------------------------
# Callbacks for Song: File, Project, and Set Name
#--------------------------------------------------------------------------------
def get_live_set_details(song, _):
"""
Handler function to return File, Project, and Set names as a tuple of length 3 when requested via OSC.

Returns:
tuple: A tuple containing the full file path, parent folder name and
song file name of the current Live Set.
"""
song_file_path = song.file_path
folder_name = os.path.basename(os.path.dirname(song_file_path))
song_file_name = os.path.basename(song_file_path)

return (song_file_path, folder_name, song_file_name)

# Register the handler function to be triggered when "/live/song/get/live_set" is received via OSC
self.osc_server.add_handler("/live/song/get/live_set", partial(get_live_set_details, self.song))

#--------------------------------------------------------------------------------
# Listener for /live/song/get/beat
Expand Down