OmegaMusic
Properties
Name The name of your component
Songs List of songs
Tag Optional property that doesn't so anything
Some methods
OmegaMusic1.Init; Initialises OmegaMusic. Call before doing anything.
OmegaMusic1.Loop; Loops all the songs that have set Loop to true. Call in your OmegaTimer.OnTimer Event.
Songs Properties
FileName Specifies the filename of your song.
Loop True if you want to loop this song, false otherwise.
Name The name the TSongListItem.
Pan Values between 1 and 100 will play the song in the right speeker, values between -1 and -100 in the left. Zero for the middle.
Volume 100 will play the song at full volume, 25 at 25% of full volume etc.
Some methods
Position: Double read to get current position, write to set current. Specified in seconds.
GetDuration: Double gives the duration of the track. Specified in seconds.
IsPlaying: Boolean returns true if the current position of the track is lower than the duration.
Load(const FileName: String) loads a new file to Item.
Play Plays the song.
Stop Stops the song.
Pause Pauses the song.
Init Initialises the song. Use for dynamic loading.
Quick example
OmegaMusic1.Init;
OmegaMusic1.Loop;
OmegaMusic1.Songs.Items[0].Position := 3.14;
FindDuration := OmegaMusic1.Songs.Items[0].GetDuration;
if OmegaMusic1.Songs.Items[0].IsPlaying then Caption := 'Playing';
OmegaMusic1.Songs.Items[0].Load('hi.wav');
OmegaMusic1.Songs.Items[0].Play;
OmegaMusic1.Songs.Items[0].Stop;
OmegaMusic1.Songs.Items[0].Pause;
OmegaMusic1.Songs.Items[0].Init;
Back to main page