|
Player-Problem
#312536
02/25/10 13:47
02/25/10 13:47
|
Joined: Feb 2010
Posts: 8
gamewriter97
OP
Newbie
|
OP
Newbie
Joined: Feb 2010
Posts: 8
|
Ich habe einen Code der aber nicht funktioniert.Ich vermute mal das es am Ordner-Browser liegt.Da ich aber nciht an genügend Kenntnis dazu habe um ihn zu reparieren frage ich nun euch. Kompletter Code:
#include <acknex.h>
#include <windows.h>
#include <default.c>
SOUND* playme;
STRING* OB_E_NAME_STR;
var mouse_left_pressed = 0;
function call_music()
{
OPENFILENAME my_file;
char buf[256];
FillMemory (&my_file,sizeof(my_file),0);
FillMemory (buf,256,0);
my_file.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
my_file.lStructSize = sizeof(my_file);
my_file.hwndOwner = hWnd;
my_file.lpstrFilter = "Musicfiles (*.mp3; *.wav; *.mid; *.ogg) \0*.mp3;*.ogg;*.wav;*.mid\0\0";
my_file.lpstrInitialDir = _chr("");
my_file.lpstrFile = buf;
my_file.nMaxFile = 255;
my_file.lpstrTitle = "Load Musicfile:";
while (key_any) wait(1);
if (GetOpenFileName(&my_file))
{
str_cpy (OB_E_NAME_STR,my_file.lpstrFile);
// add here the things to play the music. OB_E_NAME_STR is the name of the file. Example:
playme = snd_create(OB_E_NAME_STR);
}
}
function quit_program()
{
while (key_any) { wait (1); }
sys_exit(NULL);
}
void main()
{
level_load(NULL);
on_o = call_music;
}
BMAP* hhhhh = "play.tga";
PANEL* Play =
{
bmap = hhhhh;
flags = SHOW;
}
BMAP* hhhh = "stop.tga";
PANEL* stop =
{
bmap = hhhh;
flags = SHOW;
}
BMAP* hhh = "pause.tga";
PANEL* pause =
{
bmap = hhh;
flags = SHOW;
}
BMAP* hh = "vor.tga";
PANEL* vor =
{
bmap = hh;
flags = SHOW;
}
BMAP* h = "rueck.tga";
PANEL* rueck =
{
bmap = h;
flags = SHOW;
}
BMAP* gg = "Obereleiste.tga";
PANEL* rueckggg =
{
bmap = gg;
flags = SHOW;
}
BMAP* ggfgg = "Obereleiste.tga";
PANEL* leiste =
{
bmap = ggfgg;
flags = SHOW;
}
PANEL* Sliderbutton =
{
flags = SHOW;
button(2,1, "1o.tga", "1.tga", "1o.tga", call_music , NULL, NULL);
}
PANEL* Sliderbutton2 =
{
button(2,0, "2o.tga", "2.tga", "2o.tga", NULL , NULL, NULL);
flags = SHOW;
}
PANEL* Sliderbutton3 =
{
button(2,0, "3o.tga", "3.tga", "3o.tga",NULL , NULL, NULL);
flags = SHOW;
}
PANEL* slider =
{
pos_x = 600;
pos_y = 470;
bmap = "Slider02.tga";
hslider(22,6,45,"Sliderbutton.tga",6,10, slider);
flags = OVERLAY | VISIBLE;
}
function main()
{
vec_set(screen_size,vector(800,800,0));
vec_set(sky_color,vector(255,255,255)); // dark blue
vec_set(camera.x,vector(-250,0,50));
vec_set(camera.pan,vector(0,-15,0));
on_o = call_music;
mouse_mode = 2;
while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait (1);
Play.pos_x = 330; // gewünschte Position
Play.pos_y = 480;
stop.pos_x = 210; // gewünschte Position
stop.pos_y = 490;
pause.pos_x = 490; // gewünschte Position
pause.pos_y = 494;
vor.pos_x = 610; // gewünschte Position
vor.pos_y = 494;
rueck.pos_x = 90; // gewünschte Position
rueck.pos_y = 490;
slider.pos_x = 590; // gewünschte Position
slider.pos_y = 450;
Sliderbutton.pos_x = 0; // gewünschte Position
Sliderbutton.pos_y = 1;
Sliderbutton2.pos_x = 90; // gewünschte Position
Sliderbutton2.pos_y = 2;
Sliderbutton3.pos_x = 140; // gewünschte Position
Sliderbutton3.pos_y = 2.9 ;
leiste.pos_x = 0; // gewünschte Position
leiste.pos_y = 420;
////////////////////////////////////////////////
if((mouse_pos.x > Play.pos_x && mouse_pos.x<(Play.pos_x+Play.size_x)) &&
(mouse_pos.y > Play.pos_y && mouse_pos.y<(Play.pos_y+Play.size_y)) &&
mouse_left_pressed == 0)
{
if(playme != 0)
snd_play(playme,100,0);
}
////////////////////////////////////////
wait(1);
}
}
Browser Code:
function call_music()
{
OPENFILENAME my_file;
char buf[256];
FillMemory (&my_file,sizeof(my_file),0);
FillMemory (buf,256,0);
my_file.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
my_file.lStructSize = sizeof(my_file);
my_file.hwndOwner = hWnd;
my_file.lpstrFilter = "Musicfiles (*.mp3; *.wav; *.mid; *.ogg) \0*.mp3;*.ogg;*.wav;*.mid\0\0";
my_file.lpstrInitialDir = _chr("");
my_file.lpstrFile = buf;
my_file.nMaxFile = 255;
my_file.lpstrTitle = "Load Musicfile:";
while (key_any) wait(1);
if (GetOpenFileName(&my_file))
{
str_cpy (OB_E_NAME_STR,my_file.lpstrFile);
// add here the things to play the music. OB_E_NAME_STR is the name of the file. Example:
playme = snd_create(OB_E_NAME_STR);
}
}
Last edited by gamewriter97; 02/25/10 13:47.
|
|
|
Re: Player-Problem
[Re: gamewriter97]
#312614
02/25/10 17:28
02/25/10 17:28
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Das Programm steckt.wenn ich ich bzw. er in den ordner browser geht und dann eine datei auswählt und dann auf öffnen klickt!Dann steht noch irg. ne fehlermeldung da! Haha na super, jetzt beginnt das lustige Ratespielchen, welche Fehlermeldung das ist oder wie? Warum schreibst du nicht, was genau dein Problem ist, speziell welche Fehlermeldung?
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Player-Problem
[Re: Superku]
#312637
02/25/10 18:49
02/25/10 18:49
|
Joined: Feb 2010
Posts: 8
gamewriter97
OP
Newbie
|
OP
Newbie
Joined: Feb 2010
Posts: 8
|
Bei mp3 dateien wenn ich öffne kommt: 3 Stück Hintereinander! "Invalid arguments in call_music " "Emty Pointer in call_music" "Can´t play sound wav/only mono/only" Und bei manchen mp3Dateien, stürzt das programm ab, dass heißt : http://img.webme.com/pic/c/com-soft-tec/shot1.jpg
Last edited by gamewriter97; 02/25/10 18:49.
|
|
|
Re: Player-Problem
[Re: atari98]
#312763
02/26/10 12:58
02/26/10 12:58
|
Joined: Jan 2010
Posts: 112
Robso661
Member
|
Member
Joined: Jan 2010
Posts: 112
|
du hast doch ein bild angehängt, indem man sieht was passiert wenn das programm abstürtzt. dann klick, wenn sich dieses "das programm muss beendet werden" fenster öffnet, auf debug da ist doch ein button und schreib mal was dann passiert
habe noch ne frage: passiert, das mit dem stecken bleiben nur wenn du mp3 dateien öffnest...
könntest du einmal dein ganzes peojekt hochladen? dann würde ich es mir runterladen und teste es einmal selbst... wäre echt ne hilfe für mich
Last edited by Robso661; 02/26/10 13:30.
|
|
|
|