Class SongEditorManager
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
You can register to get some change events (opened, saved, closed) from any song managed by this object.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
Programmatically close all the editors associated to a song.getEditors
(Song s) Get the editors which show song s.static SongEditorManager
void
void
showPianoRollEditor
(Song song) Show the PianoRollEditorTopComponent for the specified song.showPianoRollEditorForSptCustomPhrase
(Song song, MidiMix midiMix, SongPart spt, RhythmVoice rv, Phrase p) Open (or show) the song's PianoRollEditor and set it up to edit a custom phrase of a SongPart.showPianoRollEditorForUserTrack
(Song song, MidiMix midiMix, UserRhythmVoice userRhythmVoice) Open (or show) the song's PianoRollEditor and set it up to edit a user track associated to userRhythmVoice.Load a song from a file and show it.void
Do what's required to show a song in the application.
-
Field Details
-
PROP_SONG_OPENED
This property change event is fired when a song is opened.NewValue is the song object.
- See Also:
-
PROP_SONG_CLOSED
This property change event is fired when a song is closed.NewValue is the song object. Note that a Song object also fires a Closed event when it is closed by the SongEditorManager.
- See Also:
-
PROP_SONG_SAVED
This property change event is fired when a song is saved.NewValue is the song object. This is just a forward of a Song Saved event.
- See Also:
-
-
Constructor Details
-
SongEditorManager
public SongEditorManager()
-
-
Method Details
-
getInstance
-
closeSong
Programmatically close all the editors associated to a song.- Parameters:
song
-enforce
- If true, close the song unconditionnaly (disable user prompt if song is not saved)- Returns:
- True if all editors were successfully closed, false if user blocked the closing due to unsaved song
-
showSong
Do what's required to show a song in the application.Creates undomanager, creates and shows editors. Opens the possible links in song memo is makeActive is true. Opens the PianoRollEditor if there is a user track.
If song is already shown in an editor, just makes its TopComponent active.
- Parameters:
song
-makeActive
- If true try to make the song musically active, see ActiveSongManager.savable
- If true, song will appear as modified/savable (save button enabled).
-
showSong
public Song showSong(File f, boolean makeActive, boolean updateLastSongDirectory) throws SongCreationException Load a song from a file and show it.Load the song from file, fix the MidiMix if required, and call showSong(song, makeActive).
- Parameters:
f
-makeActive
-updateLastSongDirectory
- If true and the file is not already shown, update the LastSongDirectory in FileDirectoryManager.- Returns:
- The created song from file f
- Throws:
SongCreationException
-
showPianoRollEditor
Show the PianoRollEditorTopComponent for the specified song.Song must be already edited. Create the PianoRollEditorTopComponent at the appropriate position, or just activate it.
- Parameters:
song
-- Returns:
-
showPianoRollEditorForUserTrack
public PianoRollEditorTopComponent showPianoRollEditorForUserTrack(Song song, MidiMix midiMix, UserRhythmVoice userRhythmVoice) Open (or show) the song's PianoRollEditor and set it up to edit a user track associated to userRhythmVoice.- Parameters:
song
-midiMix
-userRhythmVoice
-- Returns:
-
showPianoRollEditorForSptCustomPhrase
public PianoRollEditorTopComponent showPianoRollEditorForSptCustomPhrase(Song song, MidiMix midiMix, SongPart spt, RhythmVoice rv, Phrase p) Open (or show) the song's PianoRollEditor and set it up to edit a custom phrase of a SongPart.- Parameters:
song
-spt
- The SongPart for which a phrase is customizedrv
- The RhythmVoice for which we customize the phrasep
- The customized phrase- Returns:
-
getOpenedSongs
-
getEditors
Get the editors which show song s.- Parameters:
s
-- Returns:
- Can be null.
-
addPropertyChangeListener
-
removePropertyChangeListener
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-