Einzelnen Beitrag anzeigen
Alt 30.12.2002, 14:31   #6
harry3
Inventar
 
Registriert seit: 11.06.2001
Alter: 39
Beiträge: 2.397


harry3 eine Nachricht über ICQ schicken
Standard Hallo!

Also, wie schon gesagt, ich bin ein XML-Mensch , aber manche Fragen kann ich dir von C auch erklären.
Sounds sind eigentlich nur in C realisierbar. XML kann man da (fast)vergessen.
Sounds kannst du mit der fssound.dll in dein Gauge einbinden.
Die FsSound.dll ist im Gauge-Tut. von Dai Griffiths inkludiert. Es ist die "Developer Version", die du brauchst.

Wenn du C beherrscht, wird auch dies kein allzugroßes Problem für dich darstellen.

Viele Grüße
Harri

P.S.: @Atze: Deine Signatur ist nicht gerade toll, wenn man Gauges und so bauen will, und dann da steht, "Was schlecht ist kann ich noch schlechter". Ein bisschen positiv denken ist manchmal sehr vortilhaft

Ein kleiner Ausschnitt aus einem Gauge, der Bereich den ich beigefügt habe, ist für den Sound zuständig.



// --------------------------------------------------------------------------
// MOUSE CALLBACKS
// --------------------------------------------------------------------------
BOOL FSAPI mouse_left_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags) {
// play a sound buffer exaclty once
// There are different play macros for file and resource sounds. The
// reason behind this is, that sound buffers can get lost (e.g. when the
// application looses input focus) and in such a case, the FSSound module
// returns false from it's Play() function. To restore a lost sound buffer,
// one can simply reregister it with the apropriate register function
// (RegisterFile() or RegisterRes()). This is exactly what the play macros
// do behind the scene and that's the reason for the two different macros.
MFSSoundResPlay(left_sound, FALSE);
return FALSE;
}

BOOL FSAPI mouse_right_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags) {
// play a sound buffer from a sound file
MFSSoundFilePlay(right_sound, FALSE);
return FALSE;
}



// --------------------------------------------------------------------------
// DRAWING ELEMENT CALLBACKS
// --------------------------------------------------------------------------
// icon callbacks
FLOAT64 FSAPI left_cb(PELEMENT_ICON pelement) {
// you can check whether a sound buffer is currently playing
return MFSSoundIsPlaying(left_sound);
}

FLOAT64 FSAPI right_cb(PELEMENT_ICON pelement) {
// the button shows "on" while the sound buffer is playing
return MFSSoundIsPlaying(right_sound);
}



// --------------------------------------------------------------------------
// MAIN GAUGE CALLBACK
// --------------------------------------------------------------------------
void FSAPI over_cb(PGAUGEHDR pgauge, int service_id, UINT32 extra_data) {
switch(service_id) {
case PANEL_SERVICE_POST_INSTALL:
// sounds need to be registered before they can be played
MFSSoundFileRegister(right_sound);
// for sound resources, the handle of the module must be specified
MFSSoundResRegister(left_sound, (HMODULE)extra_data);

// the sound controlled by the left button should only be played
// on the left seaker
MFSSoundSetPan(left_sound, -10000);
// same for the sound controlled by the right button
MFSSoundSetPan(right_sound, 10000);
break;

case PANEL_SERVICE_PRE_KILL:
// never forget to unregister the sounds
MFSSoundUnregister(left_sound);
MFSSoundUnregister(right_sound);
break;
}
}


harry3 ist offline   Mit Zitat antworten