summaryrefslogtreecommitdiff
path: root/src/music
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-04-17 20:23:13 +0000
committerbelugas <belugas@openttd.org>2007-04-17 20:23:13 +0000
commit607a55f4ec509649d3799df9dff54a28d074e693 (patch)
treeb4ba94aa4f1173fcc27e954fd5d4ed6561876881 /src/music
parentc39ab93daa5af53272b108a628ed2e857b95fb64 (diff)
downloadopenttd-607a55f4ec509649d3799df9dff54a28d074e693.tar.xz
(svn r9662) -Documentation: Doxygen corrections and @file omissions
Diffstat (limited to 'src/music')
-rw-r--r--src/music/bemidi.cpp2
-rw-r--r--src/music/dmusic.cpp33
2 files changed, 19 insertions, 16 deletions
diff --git a/src/music/bemidi.cpp b/src/music/bemidi.cpp
index be8535d89..0cf500a50 100644
--- a/src/music/bemidi.cpp
+++ b/src/music/bemidi.cpp
@@ -1,5 +1,7 @@
/* $Id$ */
+/** @file bemidi.cpp */
+
#include "../stdafx.h"
#include "../openttd.h"
#include "bemidi.h"
diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp
index 3846878cd..f0538c678 100644
--- a/src/music/dmusic.cpp
+++ b/src/music/dmusic.cpp
@@ -1,5 +1,7 @@
/* $Id$ */
+/** @file dmusic.cpp */
+
#ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT
#include "../stdafx.h"
@@ -14,13 +16,13 @@
#include <dmusicf.h>
-// the performance object controls manipulation of the segments
+/** the performance object controls manipulation of the segments */
static IDirectMusicPerformance* performance = NULL;
-// the loader object can load many types of DMusic related files
+/** the loader object can load many types of DMusic related files */
static IDirectMusicLoader* loader = NULL;
-// the segment object is where the MIDI data is stored for playback
+/** the segment object is where the MIDI data is stored for playback */
static IDirectMusicSegment* segment = NULL;
static bool seeking = false;
@@ -54,12 +56,12 @@ static const char* DMusicMidiStart(const char* const* parm)
return "ole32.dll load failed";
}
- // Initialize COM
+ /* Initialize COM */
if (FAILED(proc.CoInitialize(NULL))) {
return "COM initialization failed";
}
- // create the performance object
+ /* create the performance object */
if (FAILED(proc.CoCreateInstance(
CLSID_DirectMusicPerformance,
NULL,
@@ -71,7 +73,7 @@ static const char* DMusicMidiStart(const char* const* parm)
return "Failed to create the performance object";
}
- // initialize it
+ /* initialize it */
if (FAILED(performance->Init(NULL, NULL, NULL))) {
performance->Release();
performance = NULL;
@@ -79,7 +81,7 @@ static const char* DMusicMidiStart(const char* const* parm)
return "Failed to initialize performance object";
}
- // choose default Windows synth
+ /* choose default Windows synth */
if (FAILED(performance->AddPort(NULL))) {
performance->CloseDown();
performance->Release();
@@ -88,7 +90,7 @@ static const char* DMusicMidiStart(const char* const* parm)
return "AddPort failed";
}
- // create the loader object; this will be used to load the MIDI file
+ /* create the loader object; this will be used to load the MIDI file */
if (FAILED(proc.CoCreateInstance(
CLSID_DirectMusicLoader,
NULL,
@@ -136,7 +138,7 @@ static void DMusicMidiStop()
static void DMusicMidiPlaySong(const char* filename)
{
- // set up the loader object info
+ /* set up the loader object info */
DMUS_OBJECTDESC obj_desc;
ZeroMemory(&obj_desc, sizeof(obj_desc));
obj_desc.dwSize = sizeof(obj_desc);
@@ -148,13 +150,13 @@ static void DMusicMidiPlaySong(const char* filename)
obj_desc.wszFileName, lengthof(obj_desc.wszFileName)
);
- // release the existing segment if we have any
+ /* release the existing segment if we have any */
if (segment != NULL) {
segment->Release();
segment = NULL;
}
- // make a new segment
+ /* make a new segment */
if (FAILED(loader->GetObject(
&obj_desc, IID_IDirectMusicSegment, (LPVOID*)&segment
))) {
@@ -162,7 +164,7 @@ static void DMusicMidiPlaySong(const char* filename)
return;
}
- // tell the segment what kind of data it contains
+ /* tell the segment what kind of data it contains */
if (FAILED(segment->SetParam(
GUID_StandardMIDIFile, 0xFFFFFFFF, 0, 0, performance
))) {
@@ -170,13 +172,13 @@ static void DMusicMidiPlaySong(const char* filename)
return;
}
- // tell the segment to 'download' the instruments
+ /* tell the segment to 'download' the instruments */
if (FAILED(segment->SetParam(GUID_Download, 0xFFFFFFFF, 0, 0, performance))) {
DEBUG(driver, 0, "DirectMusic: failed to download instruments");
return;
}
- // start playing the MIDI file
+ /* start playing the MIDI file */
if (FAILED(performance->PlaySegment(segment, 0, 0, NULL))) {
DEBUG(driver, 0, "DirectMusic: PlaySegment failed");
return;
@@ -210,8 +212,7 @@ static bool DMusicMidiIsSongPlaying()
static void DMusicMidiSetVolume(byte vol)
{
- // 0 - 127 -> -2000 - 0
- long db = vol * 2000 / 127 - 2000;
+ long db = vol * 2000 / 127 - 2000; ///< 0 - 127 -> -2000 - 0
performance->SetGlobalParam(GUID_PerfMasterVolume, &db, sizeof(db));
}