![]() |
![]() |
![]() |
GPS04 Reference Manual | ![]() |
---|---|---|---|---|
#include <PS04-rhythm-file.h> PS04RhythmFile; typedef PS04RhythmPatternArray; #define PS04_RHYTHM_FILE_N_PATTERNS PS04RhythmFile* ps04_rhythm_file_new (void); PS04RhythmFile* ps04_rhythm_file_new_from_project_file (const PS04ProjectFile *project_file); PS04RhythmSong* ps04_rhythm_file_get_song (PS04RhythmFile *self); void ps04_rhythm_file_load_nth_pattern (PS04RhythmFile *self, guint index, PS04RhythmPattern *pattern); void ps04_rhythm_file_load_patterns (PS04RhythmFile *self, PS04RhythmPatternArray patterns, GError **error); void ps04_rhythm_file_open (PS04RhythmFile *self, GError **error);
The PS04RhythmFile class represents a rhythm file (RHYTHMxx.SEQ) on the PS-04 memory card. Each rhythm file corresponds to one project.
A new file object is usually created with
ps04_rhythm_file_new_from_project_file()
, supplying an existing
PS04ProjectFile. You open it with ps04_rhythm_file_open()
, then load
the rhythm patterns with ps04_rhythm_file_load_patterns()
.
typedef PS04RhythmPattern *PS04RhythmPatternArray[PS04_RHYTHM_FILE_N_PATTERNS];
The PS04RhythmPatternArray type defines an array of PS04RhythmPattern that can be loaded from a PS04RhythmFile.
#define PS04_RHYTHM_FILE_N_PATTERNS 511
Defines the number of rhythm patterns per project.
PS04RhythmFile* ps04_rhythm_file_new (void);
Creates a new, empty PS04RhythmFile object, doing nothing in terms of actual file storage.
Returns : | a new PS04RhythmFile. |
PS04RhythmFile* ps04_rhythm_file_new_from_project_file (const PS04ProjectFile *project_file);
Creates a new PS04RhythmFile object, guessing its file name from
the supplied project_file
. Like ps04_rhythm_file_new()
, it does
nothing to the file system.
project_file : |
A PS04ProjectFile regarded as “sibling” to the rhythm file. |
Returns : | a new PS04RhythmFile. |
PS04RhythmSong* ps04_rhythm_file_get_song (PS04RhythmFile *self);
Gets the song stored in the rhythm file.
self : |
A PS04RhythmFile. |
Returns : | a PS04RhythmSong. |
void ps04_rhythm_file_load_nth_pattern (PS04RhythmFile *self, guint index, PS04RhythmPattern *pattern);
Loads the pattern with index
from the file into pattern
.
self : |
A PS04RhythmFile. |
index : |
The index of the pattern to load. |
pattern : |
A destination PS04RhythmPattern object. |
void ps04_rhythm_file_load_patterns (PS04RhythmFile *self, PS04RhythmPatternArray patterns, GError **error);
Loads the patterns of an open rhythm file into patterns
.
self : |
A PS04RhythmFile. |
patterns : |
The buffer to load the patterns in. |
error : |
void ps04_rhythm_file_open (PS04RhythmFile *self, GError **error);
Opens a rhythm file. If the function fails, error
is set. The file
should later be closed with ps04_file_close()
.
self : |
A PS04RhythmFile. |
error : |
A placeholder for a GError, or NULL .
|