Subversion Repositories eduke32

Rev

Rev 8390 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8390 Rev 8782
Line 33... Line 33...
33
33
34
static midifuncs MUSIC_MidiFunctions;
34
static midifuncs MUSIC_MidiFunctions;
35
35
36
#define MUSIC_SetErrorCode(status) MUSIC_ErrorCode = (status);
36
#define MUSIC_SetErrorCode(status) MUSIC_ErrorCode = (status);
37
37
38
const char *MUSIC_ErrorString(int ErrorNumber)
38
const char *MUSIC_ErrorString(int const ErrorNumber)
39
{
39
{
40
    const char *ErrorString;
-
 
41
-
 
42
    switch (ErrorNumber)
40
    switch (ErrorNumber)
43
    {
41
    {
44
        case MUSIC_Warning:
42
        case MUSIC_Warning:
45
        case MUSIC_Error:       ErrorString = MUSIC_ErrorString(MUSIC_ErrorCode); break;
43
        case MUSIC_Error:       return MUSIC_ErrorString(MUSIC_ErrorCode);
46
        case MUSIC_Ok:          ErrorString = "Music ok."; break;
44
        case MUSIC_Ok:          return "Music ok.";
47
        case MUSIC_MidiError:   ErrorString = "Error playing MIDI file."; break;
45
        case MUSIC_MidiError:   return "Error playing MIDI file.";
48
        default:                ErrorString = "Unknown Music error code."; break;
46
        default:                return "Unknown Music error code.";
49
    }
47
    }
50
-
 
51
    return ErrorString;
-
 
52
}
48
}
53
49
54
50
55
int MUSIC_Init(int SoundCard)
51
int MUSIC_Init(int SoundCard)
56
{
52
{
Line 106... Line 102...
106
102
107
103
108
int MUSIC_Shutdown(void)
104
int MUSIC_Shutdown(void)
109
{
105
{
110
    MIDI_StopSong();
106
    MIDI_StopSong();
111
-
 
112
    return MUSIC_Ok;
107
    return MUSIC_Ok;
113
}
108
}
114
109
115
110
116
void MUSIC_SetVolume(int volume) { MIDI_SetVolume(min(max(0, volume), 255)); }
111
void MUSIC_SetVolume(int volume) { MIDI_SetVolume(clamp(volume, 0, 255)); }
117
-
 
118
-
 
119
int MUSIC_GetVolume(void) { return MIDI_GetVolume(); }
112
int  MUSIC_GetVolume(void)       { return MIDI_GetVolume(); }
120
void MUSIC_SetLoopFlag(int loopflag) { MIDI_SetLoopFlag(loopflag); }
113
void MUSIC_SetLoopFlag(int loop) { MIDI_SetLoopFlag(loop); }
121
void MUSIC_Continue(void) { MIDI_ContinueSong(); }
114
void MUSIC_Continue(void)        { MIDI_ContinueSong(); }
122
void MUSIC_Pause(void) { MIDI_PauseSong(); }
115
void MUSIC_Pause(void)           { MIDI_PauseSong(); }
123
116
124
int MUSIC_StopSong(void)
117
int MUSIC_StopSong(void)
125
{
118
{
126
    MIDI_StopSong();
119
    MIDI_StopSong();
127
    MUSIC_SetErrorCode(MUSIC_Ok);
120
    MUSIC_SetErrorCode(MUSIC_Ok);
Line 144... Line 137...
144
137
145
    return MUSIC_Ok;
138
    return MUSIC_Ok;
146
}
139
}
147
140
148
141
149
void MUSIC_Update(void)
142
void MUSIC_Update(void) {}
150
{
-
 
151
}
-