#include "draw_thread.h"
#include "qt_gldraw.h"
+#include "qt_glutil_gl2_0.h"
#include "agar_logger.h"
#include "menu_disk.h"
#include "menu_bubble.h"
#include "menu_flags.h"
+#include "dialog_movie.h"
#include "../avio/movie_saver.h"
// emulation core
#endif
}
+
void Object_Menu_Control::do_save_as_movie(void)
{
int fps = 0;
QString path = QString::fromUtf8("Saved_Movie_") + tmps + QString::fromUtf8("mp4");
if(emu->get_osd() == NULL) return;
path = QString::fromLocal8Bit(emu->get_osd()->get_app_path()) + path;
-
- int num = getNumber();
+ int rate = emu->get_osd()->get_sound_rate();
+
+ int num = config.video_frame_rate;
if((num <= 0) || (num > 75)) return;
fps = num;
emit sig_start_record_movie(fps);
- emit sig_save_as_movie(path, fps);
+ emit sig_save_as_movie(path, fps, rate);
}
void Object_Menu_Control::do_stop_saving_movie(void)
emit sig_stop_saving_movie();
}
+void Ui_MainWindow::rise_movie_dialog(void)
+{
+ CSP_DialogMovie *dlg = new CSP_DialogMovie(hSaveMovieThread, 0);
+ dlg->setWindowTitle(QApplication::translate("CSP_DialogMovie", "Configure movie encodings", 0));
+ dlg->show();
+}
+
void Ui_MainWindow::LaunchEmuThread(void)
{
QString objNameStr;
# endif
for(int ii = 0; ii < drvs; ii++) {
menu_fds[ii]->setEmu(emu);
+ connect(menu_fds[ii], SIGNAL(sig_update_inner_fd(int ,QStringList , class Action_Control **, QStringList , int, bool)),
+ this, SLOT(do_update_inner_fd(int ,QStringList , class Action_Control **, QStringList , int, bool)));
}
#endif
#if defined(USE_TAPE)
# endif
for(int ii = 0; ii < drvs; ii++) {
menu_bubbles[ii]->setEmu(emu);
+ connect(menu_bubbles[ii],
+ SIGNAL(sig_update_inner_bubble(int ,QStringList , class Action_Control **, QStringList , int, bool)),
+ this,
+ SLOT(do_update_inner_bubble(int ,QStringList , class Action_Control **, QStringList , int, bool)));
}
#endif
QImageReader *reader = new QImageReader(":/background.png");
QImage *result = new QImage(reader->read()); // this acts as a default if the size is not matched
glv->updateBitmap(result);
+ emu->get_osd()->upload_bitmap(result);
delete result;
delete reader;
+ emu->get_osd()->set_buttons();
#endif
AGAR_DebugLog(AGAR_LOG_DEBUG, "DrawThread : Start.");
connect(hDrawEmu, SIGNAL(sig_draw_frames(int)), hRunEmu, SLOT(print_framerate(int)));
this, SLOT(resize_statusbar(int, int)));
connect(hRunEmu, SIGNAL(sig_resize_uibar(int, int)),
this, SLOT(resize_statusbar(int, int)));
-
+
+ connect(emu->get_osd(), SIGNAL(sig_req_encueue_video(int, int, int)),
+ hDrawEmu, SLOT(do_req_encueue_video(int, int, int)));
connect(hRunEmu, SIGNAL(sig_finished()), glv, SLOT(releaseKeyCode(void)));
connect(hRunEmu, SIGNAL(sig_finished()), this, SLOT(delete_emu_thread()));
objNameStr = QString("EmuDrawThread");
AGAR_DebugLog(AGAR_LOG_DEBUG, "DrawThread : Launch done.");
hSaveMovieThread = new MOVIE_SAVER(640, 400, 30, emu->get_osd());
- for(int i = 0; i < (CSP_MAINWIDGET_SAVE_MOVIE_END - 1); i++) {
- connect(action_SaveAsMovie[i]->binds, SIGNAL(sig_save_as_movie(QString, int)), hSaveMovieThread, SLOT(do_open(QString, int)));
- connect(action_SaveAsMovie[i]->binds, SIGNAL(sig_start_record_movie(int)), hRunEmu, SLOT(doStartRecordVideo(int)));
- connect(action_SaveAsMovie[i], SIGNAL(triggered()), action_SaveAsMovie[i]->binds, SLOT(do_save_as_movie()));
- }
- connect(action_StopSavingMovie->binds, SIGNAL(sig_stop_record_movie()), hRunEmu, SLOT(doStopRecordVideo()));
- connect(action_StopSavingMovie->binds, SIGNAL(sig_stop_saving_movie()), hSaveMovieThread, SLOT(do_close()));
- connect(action_StopSavingMovie, SIGNAL(triggered()), action_StopSavingMovie->binds, SLOT(do_stop_saving_movie()));
-
+
+ connect(actionStart_Record_Movie->binds, SIGNAL(sig_save_as_movie(QString, int, int)),
+ hSaveMovieThread, SLOT(do_open(QString, int, int)));
+ connect(actionStart_Record_Movie->binds, SIGNAL(sig_start_record_movie(int)), hRunEmu, SLOT(doStartRecordVideo(int)));
+ connect(this, SIGNAL(sig_start_saving_movie()),
+ actionStart_Record_Movie->binds, SLOT(do_save_as_movie()));
+ connect(actionStart_Record_Movie, SIGNAL(triggered()), this, SLOT(do_start_saving_movie()));
+
+ connect(actionStop_Record_Movie->binds, SIGNAL(sig_stop_record_movie()), hRunEmu, SLOT(doStopRecordVideo()));
+ connect(actionStop_Record_Movie->binds, SIGNAL(sig_stop_saving_movie()), hSaveMovieThread, SLOT(do_close()));
+ connect(this, SIGNAL(sig_stop_saving_movie()), actionStop_Record_Movie->binds, SLOT(do_stop_saving_movie()));
+ connect(actionStop_Record_Movie, SIGNAL(triggered()), this, SLOT(do_stop_saving_movie()));
+
+ actionStop_Record_Movie->setIcon(QIcon(":/icon_process_stop.png"));
+ actionStop_Record_Movie->setVisible(false);
+
+ connect(this, SIGNAL(sig_movie_set_width(int)), hSaveMovieThread, SLOT(do_set_width(int)));
+ connect(this, SIGNAL(sig_movie_set_height(int)), hSaveMovieThread, SLOT(do_set_height(int)));
+
connect(emu->get_osd(), SIGNAL(sig_movie_set_width(int)), hSaveMovieThread, SLOT(do_set_width(int)));
connect(emu->get_osd(), SIGNAL(sig_movie_set_height(int)), hSaveMovieThread, SLOT(do_set_height(int)));
- connect(emu->get_osd(), SIGNAL(sig_enqueue_audio(QByteArray *)), hSaveMovieThread, SLOT(enqueue_audio(QByteArray *)));
- connect(emu->get_osd(), SIGNAL(sig_enqueue_video(QByteArray *, int, int)), hSaveMovieThread, SLOT(enqueue_video(QByteArray *, int, int)));
+ connect(emu->get_osd(), SIGNAL(sig_enqueue_audio(int16_t*, int)), hSaveMovieThread, SLOT(enqueue_audio(int16_t *, int)));
+ connect(emu->get_osd(), SIGNAL(sig_enqueue_video(QImage *)), hSaveMovieThread, SLOT(enqueue_video(QImage *)));
+ connect(glv->extfunc, SIGNAL(sig_push_image_to_movie(QImage *)), hSaveMovieThread, SLOT(enqueue_video(QImage *)));
connect(this, SIGNAL(sig_quit_movie_thread()), hSaveMovieThread, SLOT(do_exit()));
objNameStr = QString("EmuMovieThread");
hSaveMovieThread->setObjectName(objNameStr);
hSaveMovieThread->start();
AGAR_DebugLog(AGAR_LOG_DEBUG, "MovieThread : Launch done.");
-
+
+ connect(action_SetupMovie, SIGNAL(triggered()), this, SLOT(rise_movie_dialog()));
hRunEmu->start();
AGAR_DebugLog(AGAR_LOG_DEBUG, "EmuThread : Launch done.");
this->set_screen_aspect(config.window_stretch_type);
+ emit sig_movie_set_width(SCREEN_WIDTH);
+ emit sig_movie_set_height(SCREEN_HEIGHT);
}
void Ui_MainWindow::LaunchJoyThread(void)
return 0;
}
+void Ui_MainWindow::do_update_inner_fd(int drv, QStringList base, class Action_Control **action_select_media_list,
+ QStringList lst, int num, bool use_d88_menus)
+{
+#if defined(USE_FD1)
+ if(use_d88_menus) {
+ for(int ii = 0; ii < using_flags->get_max_d88_banks(); ii++) {
+ if(ii < emu->d88_file[drv].bank_num) {
+ base << lst.value(ii);
+ action_select_media_list[ii]->setText(lst.value(ii));
+ action_select_media_list[ii]->setVisible(true);
+ if(ii == num) action_select_media_list[ii]->setChecked(true);
+ } else {
+ if(action_select_media_list[ii] != NULL) {
+ action_select_media_list[ii]->setText(QString::fromUtf8(""));
+ action_select_media_list[ii]->setVisible(false);
+ }
+ }
+ }
+ }
+#endif
+}
+
+void Ui_MainWindow::do_update_inner_bubble(int drv, QStringList base, class Action_Control **action_select_media_list,
+ QStringList lst, int num, bool use_d88_menus)
+{
+#if defined(USE_BUBBLE1)
+ if(use_d88_menus) {
+ for(int ii = 0; ii < using_flags->get_max_b77_banks(); ii++) {
+ if(ii < emu->b77_file[media_drive].bank_num) {
+ base << lst.value(ii);
+ action_select_media_list[ii]->setText(lst.value(ii));
+ action_select_media_list[ii]->setVisible(true);
+ if(ii == num) action_select_media_list[ii]->setChecked(true);
+ } else {
+ if(action_select_media_list[ii] != NULL) {
+ action_select_media_list[ii]->setText(QString::fromUtf8(""));
+ action_select_media_list[ii]->setVisible(false);
+ }
+ }
+ }
+ }
+#endif
+}
+
#ifdef USE_DEBUGGER
#include <../debugger/qt_debugger.h>