QTfrontend/net/recorder.cpp
changeset 14629 8ffa0c27f434
parent 14599 b86e6e4f3c58
child 15283 c4fd2813b127
equal deleted inserted replaced
14628:a049926fcdd3 14629:8ffa0c27f434
    21 
    21 
    22 #include "recorder.h"
    22 #include "recorder.h"
    23 #include "gameuiconfig.h"
    23 #include "gameuiconfig.h"
    24 #include "hwconsts.h"
    24 #include "hwconsts.h"
    25 #include "game.h"
    25 #include "game.h"
       
    26 #include "util/MessageDialog.h"
    26 #include "LibavInteraction.h"
    27 #include "LibavInteraction.h"
    27 
    28 
    28 // Encoding is memory expensive process, so we need to limit maximum number
    29 // Encoding is memory expensive process, so we need to limit maximum number
    29 // of simultaneous encoders.
    30 // of simultaneous encoders.
    30 static const int maxRecorders = 3;
    31 static const int maxRecorders = 3;
    74             emit onProgress((quint8(msg.at(2))*256.0 + quint8(msg.at(3)))*0.0001);
    75             emit onProgress((quint8(msg.at(2))*256.0 + quint8(msg.at(3)))*0.0001);
    75             break;
    76             break;
    76         case 'v':
    77         case 'v':
    77             finished = true;
    78             finished = true;
    78             break;
    79             break;
       
    80         case 'E':
       
    81             int size = msg.size();
       
    82             emit ErrorMessage(
       
    83                 tr("A fatal ERROR occured while processing the video recording! "
       
    84                 "The video could not be saved.\n\n"
       
    85                 "As a workaround, you could try to reset the Hedgewars video recorder settings to the defaults.\n\n"
       
    86                 "To report this error, please click the 'Feedback' button in the main menu!\n\n"
       
    87                 "Last engine message:\n%1")
       
    88                 .arg(QString::fromUtf8(msg.mid(2).left(size - 4))));
       
    89             return;
    79         }
    90         }
    80     }
    91     }
    81 }
    92 }
    82 
    93 
    83 void HWRecorder::EncodeVideo(const QByteArray & record)
    94 void HWRecorder::EncodeVideo(const QByteArray & record)