fixed newlines
fixed a crashing bug when no file was selected and play clicked set a default ramp time of 250 ms git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1293 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7d3c9b37ac
commit
b11e9aaa12
|
@ -23,4 +23,4 @@ FileSoundTest::FileSoundTest()
|
||||||
BRect windowBounds(50,50,400,170);
|
BRect windowBounds(50,50,400,170);
|
||||||
FileSoundWindow *window = new FileSoundWindow(windowBounds);
|
FileSoundWindow *window = new FileSoundWindow(windowBounds);
|
||||||
window -> Show();
|
window -> Show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,4 @@ class FileSoundTest: public BApplication
|
||||||
public:
|
public:
|
||||||
FileSoundTest();
|
FileSoundTest();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,7 +23,7 @@ FileSoundWindow::FileSoundWindow(BRect windowBounds)
|
||||||
preload = false;
|
preload = false;
|
||||||
playing = false;
|
playing = false;
|
||||||
paused = false;
|
paused = false;
|
||||||
rampTime = 0;
|
rampTime = 250000; // 250 ms default
|
||||||
fileSound = 0;
|
fileSound = 0;
|
||||||
//make openPanel and let it send its messages to this window
|
//make openPanel and let it send its messages to this window
|
||||||
openPanel = new BFilePanel();
|
openPanel = new BFilePanel();
|
||||||
|
@ -60,7 +60,7 @@ FileSoundWindow::FileSoundWindow(BRect windowBounds)
|
||||||
box -> AddChild(pauseButton);
|
box -> AddChild(pauseButton);
|
||||||
//make textcontrol to enter delay for pausing/resuming
|
//make textcontrol to enter delay for pausing/resuming
|
||||||
BRect delayBounds(pauseBounds.right + 10, pauseBounds.top,pauseBounds.right + 150, pauseBounds.bottom);
|
BRect delayBounds(pauseBounds.right + 10, pauseBounds.top,pauseBounds.right + 150, pauseBounds.bottom);
|
||||||
delayControl = new BTextControl(delayBounds,"delay","Ramp time (ms)","0", new BMessage(DELAY_MSG));
|
delayControl = new BTextControl(delayBounds,"delay","Ramp time (ms)","250", new BMessage(DELAY_MSG));
|
||||||
delayControl -> SetDivider(90);
|
delayControl -> SetDivider(90);
|
||||||
delayControl -> SetModificationMessage(new BMessage(DELAY_MSG));
|
delayControl -> SetModificationMessage(new BMessage(DELAY_MSG));
|
||||||
box -> AddChild(delayControl);
|
box -> AddChild(delayControl);
|
||||||
|
@ -123,6 +123,7 @@ void FileSoundWindow::MessageReceived(BMessage *message)
|
||||||
BAlert *alert = new BAlert("alert","Other kind of error!","Ok");
|
BAlert *alert = new BAlert("alert","Other kind of error!","Ok");
|
||||||
alert -> Go();
|
alert -> Go();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
paused = false;
|
paused = false;
|
||||||
pauseButton -> SetLabel("Pause");
|
pauseButton -> SetLabel("Pause");
|
||||||
|
|
|
@ -45,4 +45,4 @@ class FileSoundWindow : public BWindow
|
||||||
bigtime_t rampTime;
|
bigtime_t rampTime;
|
||||||
entry_ref fileref;
|
entry_ref fileref;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue