1
1
//=========================================================
3
3
// Linux Music Editor
4
// $Id: waveview.cpp,v 1.10.2.7 2005/07/09 21:55:47 lunar_shuttle Exp $
4
// $Id: waveview.cpp,v 1.10.2.8 2005/12/28 22:17:54 spamatica Exp $
5
5
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
6
6
//=========================================================
604
604
for (unsigned i=0; i<file_channels; i++) {
605
605
tmpdata[i] = new float[tmpdatalen];
608
607
file.seek(tmpdataoffset, 0);
609
608
file.read(file_channels, tmpdata, tmpdatalen);
778
777
exttmpFile.close();
780
779
// Forkaborkabork
783
if (execlp(config.externalWavEditor.latin1(), "", exttmpFileName.latin1(), 0) == -1) {
782
if (execlp(config.externalWavEditor.latin1(), config.externalWavEditor.latin1(), exttmpFileName.latin1(), 0) == -1) {
784
783
perror("Failed to launch external editor");
785
784
// Get out of here
787
// cannot report error through gui, we are in another fork!
788
788
//@!TODO: Handle unsuccessful attempts
790
793
else if (pid == -1) {
791
794
perror("fork failed");
798
waitpid(pid, &status, 0);
799
//printf ("status=%d\n",status);
800
if( WEXITSTATUS(status) != 0 ){
801
QMessageBox::warning(this, tr("MusE - external editor failed"),
802
tr("MusE was unable to launch the external editor\ncheck if the editor setting in:\n"
803
"Global Settings->Audio:External Waveditor\nis set to a valid editor."));
795
806
if (exttmpFile.openRead()) {
796
printf("Could not reopen temporary file again!\n");
807
printf("Could not reopen temporary file!\n");
799
// Re-read file again
800
exttmpFile.seek(0, 0);
801
size_t sz = exttmpFile.read(file_channels, tmpdata, tmpdatalen);
802
if (sz != tmpdatalen) {
810
// Re-read file again
811
exttmpFile.seek(0, 0);
812
size_t sz = exttmpFile.read(file_channels, tmpdata, tmpdatalen);
813
if (sz != tmpdatalen) {
803
814
// File must have been shrunken - not good. Alert user.
804
815
QMessageBox::critical(this, tr("MusE - file size changed"),
805
tr("When editing in external editor - you should not change the filesize\nsince it must fit the selected region.\n\nMissing data is muted"));
816
tr("When editing in external editor - you should not change the filesize\nsince it must fit the selected region.\n\nMissing data is muted"));
806
817
for (unsigned i=0; i<file_channels; i++) {
807
for (unsigned j=sz; j<tmpdatalen; j++) {
818
for (unsigned j=sz; j<tmpdatalen; j++) {
808
819
tmpdata[i][j] = 0;
813
824
QDir dir = exttmpFile.dirPath();
814
825
dir.remove(exttmpFileName);
815
826
dir.remove(exttmpFile.basename() + ".wca");