PS04RhythmFile

PS04RhythmFile — PS-04 rhythm file

Synopsis


#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);


Object Hierarchy


  GObject
   +----PS04Stream
         +----PS04File
               +----PS04RhythmFile

Description

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().

Details

PS04RhythmFile

typedef struct _PS04RhythmFile PS04RhythmFile;


PS04RhythmPatternArray

typedef PS04RhythmPattern *PS04RhythmPatternArray[PS04_RHYTHM_FILE_N_PATTERNS];

The PS04RhythmPatternArray type defines an array of PS04RhythmPattern that can be loaded from a PS04RhythmFile.


PS04_RHYTHM_FILE_N_PATTERNS

#define PS04_RHYTHM_FILE_N_PATTERNS 511

Defines the number of rhythm patterns per project.


ps04_rhythm_file_new ()

PS04RhythmFile* ps04_rhythm_file_new        (void);

Creates a new, empty PS04RhythmFile object, doing nothing in terms of actual file storage.

Returns : a new PS04RhythmFile.

ps04_rhythm_file_new_from_project_file ()

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.

ps04_rhythm_file_get_song ()

PS04RhythmSong* ps04_rhythm_file_get_song   (PS04RhythmFile *self);

Gets the song stored in the rhythm file.

self : A PS04RhythmFile.
Returns : a PS04RhythmSong.

ps04_rhythm_file_load_nth_pattern ()

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.

ps04_rhythm_file_load_patterns ()

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 :

ps04_rhythm_file_open ()

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.

See Also

PS04Project, PS04ProjectFile