bool CGUIDialogSmartPlaylistRule::OnMessage(CGUIMessage& message)
{
  switch ( message.GetMessage() )
  {
  case GUI_MSG_CLICKED:
    {
      int iControl = message.GetSenderId();
      if (iControl == CONTROL_OK)
        OnOK();
      else if (iControl == CONTROL_CANCEL)
        OnCancel();
      else if (iControl == CONTROL_VALUE)
      {
        std::string parameter;
        OnEditChanged(iControl, parameter);
        m_rule.SetParameter(parameter);
      }
      else if (iControl == CONTROL_OPERATOR)
        OnOperator();
      else if (iControl == CONTROL_FIELD)
        OnField();
      else if (iControl == CONTROL_BROWSE)
        OnBrowse();
      return true;
    }
    break;

  case GUI_MSG_VALIDITY_CHANGED:
    CONTROL_ENABLE_ON_CONDITION(CONTROL_OK, message.GetParam1());
    break;
  }
  return CGUIDialog::OnMessage(message);
}
void CRTFReaderTHDDlg::OnBrowse1() 
{
	OnBrowse(IDC_FILE1);

	UpdateData(true);	

	CString csExtension(m_csFile1.Right(4));

	csExtension.MakeLower();

	m_csFile2 = m_csFile1.Left(m_csFile1.GetLength()-4) + "_hidden.rtf";

	UpdateData(false);	
}
Beispiel #3
0
/*------------------------------------------------
  dialog procedure
--------------------------------------------------*/
INT_PTR CALLBACK PageMiscProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id, code;
			id = LOWORD(wParam); code = HIWORD(wParam);
			switch (id)
			{
				case IDC_NOCLOCK:
					g_bApplyClock = TRUE;
					SendPSChanged(hDlg);
					break;
				case IDC_MCIWAVE:
				case IDC_TASKBARRESTART:
#if TC_ENABLE_DESKTOPICON
				case IDC_DESKTOPICON:
				case IDC_TRANSDESKTOPICONBK:
#endif
					SendPSChanged(hDlg);
					break;
				case IDC_DELAYSTART:
					if(code == EN_CHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_BROWSEHELP:
					OnBrowse(hDlg);
					break;
			}
			return TRUE;
		}
		case WM_NOTIFY:
			switch(((NMHDR *)lParam)->code)
			{
				case PSN_APPLY: OnApply(hDlg); break;
				case PSN_HELP: MyHelp(GetParent(hDlg), "Misc"); break;
			}
			return TRUE;
	}
	return FALSE;
}
void ScriptingSettingsDlg::OnAddScript(wxCommandEvent& event)
{
    ScriptEntry se;
    se.script = _T("new.script");
    se.enabled = true;
    se.registered = false;
    m_ScriptsVector.push_back(se);

    wxListCtrl* list = XRCCTRL(*this, "chkStartupScripts", wxListCtrl);

    // update view
    long item = list->InsertItem(list->GetItemCount(), se.script);
    list->SetItem(item, 1, _("No"));
    list->SetItem(item, 2, wxString(_("No")));

    list->SetItemState(item, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED);

    OnBrowse(event);
}
Beispiel #5
0
/*----------------------------------------------------------------------
|   PLT_MediaServer::OnAction
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaServer::OnAction(PLT_ActionReference&          action, 
                          const PLT_HttpRequestContext& context)
{
    /* parse the action name */
    NPT_String name = action->GetActionDesc().GetName();
                   
    // ContentDirectory
    if (name.Compare("Browse", true) == 0) {
        return OnBrowse(action, context);
    }
    if (name.Compare("Search", true) == 0) {
        return OnSearch(action, context);
    }
    if (name.Compare("UpdateObject", true) == 0) {
        return OnUpdate(action, context);
    }
    if (name.Compare("GetSystemUpdateID", true) == 0) {
        return OnGetSystemUpdateID(action, context);
    }
    if (name.Compare("GetSortCapabilities", true) == 0) {
        return OnGetSortCapabilities(action, context);
    }  
    if (name.Compare("GetSearchCapabilities", true) == 0) {
        return OnGetSearchCapabilities(action, context);
    }  

    // ConnectionMananger
    if (name.Compare("GetCurrentConnectionIDs", true) == 0) {
        return OnGetCurrentConnectionIDs(action, context);
    }
    if (name.Compare("GetProtocolInfo", true) == 0) {
        return OnGetProtocolInfo(action, context);
    }    
    if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
        return OnGetCurrentConnectionInfo(action, context);
    }

    action->SetError(401,"No Such Action.");
    return NPT_SUCCESS;
}
Beispiel #6
0
SettingsEntryText::SettingsEntryText(QBoxLayout *parent, Settings *settings,
				     const char *label, 
				     setter_fn setter, getter_fn getter)
    : m_settings(settings),
      m_setter(setter),
      m_getter(getter),
      m_line(NULL)
{
    parent->addWidget(new QLabel(label));

    QHBoxLayout *hb = new QHBoxLayout;
    m_line = new QLineEdit;
    hb->addWidget(m_line);

    QPushButton *br = new QPushButton;
    br->setText("Browse...");
    hb->addWidget(br);
    connect(br, SIGNAL(clicked()), this, SLOT(OnBrowse()));

    parent->addLayout(hb);
}
Beispiel #7
0
/*------------------------------------------------
  dialog procedure
--------------------------------------------------*/
INT_PTR CALLBACK DlgProcSelectIcon(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			if(!InitSelectIcon(hDlg))
				EndDialog(hDlg, IDCANCEL);
			return TRUE;
		case WM_MEASUREITEM:
			OnMeasureItem(hDlg, lParam);
			return TRUE;
		case WM_DRAWITEM:
			OnDrawItem(lParam);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id;
			id = LOWORD(wParam);
			switch(id)
			{
				case IDC_SANSHOICON:
					OnBrowse(hDlg);
					break;
				case IDOK:
					OnOK(hDlg);
				case IDCANCEL:
					EndSelectIcon(hDlg);
					EndDialog(hDlg, id);
					break;
			}
			return TRUE;
		}
	}
	return FALSE;
}
Beispiel #8
0
//------------------------------------------------------------------------------
// WsdlFileView
//
WsdlFileView::WsdlFileView(const QString& host, QWidget* parent)
  : QWidget(parent),
  m_host(host),
  m_wsdlFile(WsInfo().Wsdl(host))
{
  ui.setupUi(this);

  ui.TableView->setModel(&m_model);
  ui.TableView->horizontalHeader()->hide();
  ui.TableView->verticalHeader()->hide();
  ui.TableView->horizontalHeader()->setStretchLastSection(true);
  ui.TableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
  connect(ui.TableView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnMethodDoubleClicked(const QModelIndex&)));

  ui.WsdlFileNameLabel->setText(QFileInfo(m_wsdlFile->FileName()).fileName());
  ui.WsdlFileNameLabel->setToolTip(QDir::toNativeSeparators(m_wsdlFile->FileName()));

  connect(ui.BrowseBtn, SIGNAL(clicked()), this, SLOT(OnBrowse()));
  connect(&m_model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(OnModelChanged(QStandardItem*)));
  connect(m_wsdlFile, SIGNAL(WsdlMethodUpdated()), this, SLOT(OnWsdlMethodUpdated()));

  // force update after the m_wsdlFile has been parsed and instantiated in its constructor
  QTimer::singleShot(0, this, SLOT(OnUpdate()));
}
Beispiel #9
0
void CRTFReaderTHDDlg::OnBrowse1() 
{
	OnBrowse(IDC_FILE1);

	UpdateData(true);	

	CString csExtension(m_csFile1.Right(4));

	csExtension.MakeLower();

	if (csExtension == ".wse")
	{
		csExtension = ".mcy";
	}
	else if (csExtension == ".mcy")
	{
		csExtension = ".wse";
	}
	else return;

	m_csFile2 = m_csFile1.Left(m_csFile1.GetLength() - 4) + csExtension;

	UpdateData(false);	
}
Beispiel #10
0
/*-------------------------------------------
  dialog procedure
---------------------------------------------*/
INT_PTR CALLBACK DlgProcTimer(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			int id, code;
			id = LOWORD(wParam); code = HIWORD(wParam);
			switch(id)
			{
				case IDC_TIMERNAME:
					if(code == CBN_SELCHANGE)
						OnName(hDlg);
					else if(code == CBN_DROPDOWN)
						OnNameDropDown(hDlg);
					break;
				case IDC_TIMERADD:
					OnAdd(hDlg);
					break;
				case IDC_TIMERDEL:
					OnDelete(hDlg);
					break;
				case IDC_TIMERSANSHO:
					OnBrowse(hDlg);
					break;
				case IDC_TIMERTEST:
					OnTest(hDlg);
					break;
				case IDC_SHOWTIME:
					OnShowTime(hDlg);
					break;
				case IDC_SHOWWHOLE:
				case IDC_SHOWADD:
				case IDC_SHOWUSTR:
					OnUserStr(hDlg);
					break;
				case IDOK:
					OnOK(hDlg);
					break;
				case IDCANCEL:
					OnCancel(hDlg);
					break;
				case IDC_TIMERHELP:
					OnHelp(hDlg);
					break;
			}
			return TRUE;
		}
		// playing sound ended
		case MM_MCINOTIFY:
		case MM_WOM_DONE:
			if(message == MM_MCINOTIFY)
				OnMCINotify(hDlg, wParam, (LONG)lParam);
			else
				StopFile();
			m_bPlaying = FALSE;
			SendDlgItemMessage(hDlg, IDC_TIMERTEST,
				BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_hIconPlay);
			return TRUE;
		case WM_DESTROY:
			OnDestroy(hDlg);
			break;
	}
	return FALSE;
}
DMainWindow::DMainWindow(QWidget* parent_widget)
	: QMainWindow(parent_widget)
{
	m_ui = std::make_unique<Ui::DMainWindow>();
	m_ui->setupUi(this);

	Resources::Init();
	UpdateIcons();
	setWindowIcon(Resources::GetIcon(Resources::DOLPHIN_LOGO));

	// Create the GameList
	m_game_tracker = new DGameTracker(this);
	m_ui->centralWidget->addWidget(m_game_tracker);
	m_game_tracker->ScanForGames();
	m_game_tracker->SelectLastBootedGame();

	// Setup the GameList style switching actions
	QActionGroup* gamelistGroup = new QActionGroup(this);
	gamelistGroup->addAction(m_ui->actionListView);
	gamelistGroup->addAction(m_ui->actionTreeView);
	gamelistGroup->addAction(m_ui->actionGridView);
	gamelistGroup->addAction(m_ui->actionIconView);

	// TODO: save/load this from user prefs!
	m_ui->actionListView->setChecked(true);
	OnGameListStyleChanged();

	// Connect all the signals/slots
	connect(this, SIGNAL(CoreStateChanged(Core::EState)), this, SLOT(OnCoreStateChanged(Core::EState)));

	connect(m_ui->actionOpen, SIGNAL(triggered()), this, SLOT(OnOpen()));
	connect(m_ui->actionBrowse, SIGNAL(triggered()), this, SLOT(OnBrowse()));
	connect(m_ui->actionExit, SIGNAL(triggered()), this, SLOT(OnExit()));

	connect(m_ui->actionListView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
	connect(m_ui->actionTreeView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
	connect(m_ui->actionGridView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
	connect(m_ui->actionIconView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));

	connect(m_ui->actionPlay, SIGNAL(triggered()), this, SLOT(OnPlay()));
	connect(m_ui->actionPlay_mnu, SIGNAL(triggered()), this, SLOT(OnPlay()));
	connect(m_game_tracker, SIGNAL(StartGame()), this, SLOT(OnPlay()));
	connect(m_ui->actionStop, SIGNAL(triggered()), this, SLOT(OnStop()));
	connect(m_ui->actionStop_mnu, SIGNAL(triggered()), this, SLOT(OnStop()));
	connect(m_ui->actionReset, SIGNAL(triggered()), this, SLOT(OnReset()));

	connect(m_ui->actionWebsite, SIGNAL(triggered()), this, SLOT(OnOpenWebsite()));
	connect(m_ui->actionOnlineDocs, SIGNAL(triggered()), this, SLOT(OnOpenDocs()));
	connect(m_ui->actionGitHub, SIGNAL(triggered()), this, SLOT(OnOpenGitHub()));
	connect(m_ui->actionSystemInfo, SIGNAL(triggered()), this, SLOT(OnOpenSystemInfo()));
	connect(m_ui->actionAbout, SIGNAL(triggered()), this, SLOT(OnOpenAbout()));
	connect(m_ui->actionAboutQt, SIGNAL(triggered()), this, SLOT(OnOpenAboutQt()));

	// Update GUI items
	emit CoreStateChanged(Core::CORE_UNINITIALIZED);

	// Platform-specific stuff
#ifdef Q_OS_MACX
	m_ui->toolbar->setMovable(false);
#endif
}
Beispiel #12
0
PageOutput::PageOutput(MainWindow* main_window)
	: QWidget(main_window->centralWidget()) {

	m_main_window = main_window;

	m_old_container = (enum_container) 0;
	m_old_container_av = 0;

	// main codecs
	// (initializer lists should use explicit types for Clang)
	m_containers = {
		ContainerData({"Matroska (MKV)", "matroska", QStringList({"mkv"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("Matroska") + " (*.mkv)",
			{VIDEO_CODEC_H264, VIDEO_CODEC_VP8, VIDEO_CODEC_THEORA},
			{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC, AUDIO_CODEC_UNCOMPRESSED}}),
		ContainerData({"MP4", "mp4", QStringList({"mp4"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("MP4") + " (*.mp4)",
			{VIDEO_CODEC_H264},
			{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC}}),
		ContainerData({"WebM", "webm", QStringList({"webm"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("WebM") + " (*.webm)",
			{VIDEO_CODEC_VP8},
			{AUDIO_CODEC_VORBIS}}),
		ContainerData({"OGG", "ogg", QStringList({"ogg"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("OGG") + " (*.ogg)",
			{VIDEO_CODEC_THEORA},
			{AUDIO_CODEC_VORBIS}}),
		ContainerData({tr("Other..."), "other", QStringList(), "", std::set<enum_video_codec>({}), std::set<enum_audio_codec>({})}),
	};
	m_video_codecs = {
		{"H.264"       , "libx264"  },
		{"VP8"         , "libvpx"   },
		{"Theora"      , "libtheora"},
		{tr("Other..."), "other"    },
	};
	m_audio_codecs = {
		{"Vorbis"          , "libvorbis"   },
		{"MP3"             , "libmp3lame"  },
		{"AAC"             , "libvo_aacenc"},
		{tr("Uncompressed"), "pcm_s16le"   },
		{tr("Other...")    , "other"       },
	};

	// alternative aac codec
	if(!AVCodecIsInstalled(m_audio_codecs[AUDIO_CODEC_AAC].avname)) {
		m_audio_codecs[AUDIO_CODEC_AAC].avname = "aac";
	}

	// load AV container list
	m_containers_av.clear();
	for(AVOutputFormat *format = av_oformat_next(NULL); format != NULL; format = av_oformat_next(format)) {
		if(format->video_codec == AV_CODEC_ID_NONE)
			continue;
		ContainerData c;
		c.name = format->long_name;
		c.avname = format->name;
		c.suffixes = QString(format->extensions).split(',', QString::SkipEmptyParts);
		if(c.suffixes.isEmpty()) {
			c.filter = "";
		} else {
			c.filter = tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg(c.avname) + " (*." + c.suffixes[0];
			for(int i = 1; i < c.suffixes.size(); ++i) {
				c.suffixes[i] = c.suffixes[i].trimmed(); // needed because libav/ffmpeg isn't very consistent when they say 'comma-separated'
				c.filter += " *." + c.suffixes[i];
			}
			c.filter += ")";
		}
		m_containers_av.push_back(c);
	}
	std::sort(m_containers_av.begin(), m_containers_av.end());

	// load AV codec list
	m_video_codecs_av.clear();
	m_audio_codecs_av.clear();
	for(AVCodec *codec = av_codec_next(NULL); codec != NULL; codec = av_codec_next(codec)) {
		if(!av_codec_is_encoder(codec))
			continue;
		if(codec->type == AVMEDIA_TYPE_VIDEO && VideoEncoder::AVCodecIsSupported(codec->name)) {
			VideoCodecData c;
			c.name = codec->long_name;
			c.avname = codec->name;
			m_video_codecs_av.push_back(c);
		}
		if(codec->type == AVMEDIA_TYPE_AUDIO && AudioEncoder::AVCodecIsSupported(codec->name)) {
			AudioCodecData c;
			c.name = codec->long_name;
			c.avname = codec->name;
			m_audio_codecs_av.push_back(c);
		}
	}
	std::sort(m_video_codecs_av.begin(), m_video_codecs_av.end());
	std::sort(m_audio_codecs_av.begin(), m_audio_codecs_av.end());

	if(m_containers_av.empty()) {
		Logger::LogError("[PageOutput::PageOutput] " + tr("Error: Could not find any suitable container in libavformat!"));
		throw LibavException();
	}
	if(m_video_codecs_av.empty()) {
		Logger::LogError("[PageOutput::PageOutput] " + tr("Error: Could not find any suitable video codec in libavcodec!"));
		throw LibavException();
	}
	if(m_audio_codecs_av.empty()) {
		Logger::LogError("[PageOutput::PageOutput] " + tr("Error: Could not find any suitable audio codec in libavcodec!"));
		throw LibavException();
	}

	m_profile_box = new ProfileBox(this, "output-profiles", &LoadProfileSettingsCallback, &SaveProfileSettingsCallback, this);

	QGroupBox *groupbox_file = new QGroupBox(tr("File"), this);
	{
		QLabel *label_file = new QLabel(tr("Save as:"), groupbox_file);
		m_lineedit_file = new QLineEdit(groupbox_file);
		m_lineedit_file->setToolTip(tr("The recording will be saved to this location."));
		QPushButton *button_browse = new QPushButton(tr("Browse..."), groupbox_file);
		m_checkbox_separate_files = new QCheckBox(tr("Separate file per segment"), groupbox_file);
		m_checkbox_separate_files->setToolTip(tr("If checked, a separate video file will be created every time you pause and resume the recording.\n"
												 "If the original file name is 'test.mkv', the segments will be saved as 'test-YYYY-MM-DD_HH.MM.SS.mkv'."));
		QLabel *label_container = new QLabel(tr("Container:"), groupbox_file);
		m_combobox_container = new QComboBox(groupbox_file);
		for(unsigned int i = 0; i < CONTAINER_COUNT; ++i) {
			QString name = "\u200e" + m_containers[i].name + "\u200e";
			if(i != CONTAINER_OTHER && !AVFormatIsInstalled(m_containers[i].avname))
				name += " \u200e" + tr("(not installed)") + "\u200e";
			m_combobox_container->addItem(name);
		}
		m_combobox_container->setToolTip(tr("The container (file format) that will be used to save the recording.\n"
											"Note that not all codecs are supported by all containers, and that not all media players can read all file formats.\n"
											"- Matroska (MKV) supports all the codecs, but is less well-known.\n"
											"- MP4 is the most well-known format and will play on almost any modern media player, but supports only H.264 video\n"
											"   (and many media players only support AAC audio).\n"
											"- WebM is intended for embedding video into websites (with the HTML5 <video> tag). The format was created by Google.\n"
											"   WebM is supported by default in Firefox, Chrome and Opera, and plugins are available for Internet Explorer and Safari.\n"
											"   It supports only VP8 and Vorbis.\n"
											"- OGG supports only Theora and Vorbis."));
		m_label_container_av = new QLabel(tr("Container name:"), groupbox_file);
		m_combobox_container_av = new QComboBox(groupbox_file);
		for(unsigned int i = 0; i < m_containers_av.size(); ++i) {
			ContainerData &c = m_containers_av[i];
			m_combobox_container_av->addItem(c.avname);
		}
		m_combobox_container_av->setToolTip(tr("For advanced users. You can use any libav/ffmpeg format, but many of them are not useful or may not work."));

		connect(m_combobox_container, SIGNAL(activated(int)), this, SLOT(OnUpdateSuffixAndContainerFields()));
		connect(m_combobox_container_av, SIGNAL(activated(int)), this, SLOT(OnUpdateSuffixAndContainerFields()));
		connect(button_browse, SIGNAL(clicked()), this, SLOT(OnBrowse()));

		QGridLayout *layout = new QGridLayout(groupbox_file);
		layout->addWidget(label_file, 0, 0);
		layout->addWidget(m_lineedit_file, 0, 1);
		layout->addWidget(button_browse, 0, 2);
		layout->addWidget(m_checkbox_separate_files, 1, 0, 1, 3);
		layout->addWidget(label_container, 2, 0);
		layout->addWidget(m_combobox_container, 2, 1, 1, 2);
		layout->addWidget(m_label_container_av, 3, 0);
		layout->addWidget(m_combobox_container_av, 3, 1, 1, 2);
	}
	QGroupBox *groupbox_video = new QGroupBox(tr("Video"), this);
	{
		QLabel *label_video_codec = new QLabel(tr("Codec:"), groupbox_video);
		m_combobox_video_codec = new QComboBox(groupbox_video);
		for(unsigned int i = 0; i < VIDEO_CODEC_COUNT; ++i) {
			m_combobox_video_codec->addItem(m_video_codecs[i].name);
		}
		m_combobox_video_codec->setToolTip(tr("The codec that will be used to compress the video stream.\n"
											  "- H.264 (libx264) is by far the best codec - high quality and very fast.\n"
											  "- VP8 (libvpx) is quite good but also quite slow.\n"
											  "- Theora (libtheora) isn't really recommended because the quality isn't very good."));
		m_label_video_codec_av = new QLabel(tr("Codec name:"), groupbox_video);
		m_combobox_video_codec_av = new QComboBox(groupbox_video);
		for(unsigned int i = 0; i < m_video_codecs_av.size(); ++i) {
			VideoCodecData &c = m_video_codecs_av[i];
			m_combobox_video_codec_av->addItem(c.avname);
		}
		m_combobox_video_codec_av->setToolTip(tr("For advanced users. You can use any libav/ffmpeg video codec, but many of them are not useful or may not work."));
		m_label_video_kbit_rate = new QLabel(tr("Bit rate (in kbps):"), groupbox_video);
		m_lineedit_video_kbit_rate = new QLineEdit(groupbox_video);
		m_lineedit_video_kbit_rate->setToolTip(tr("The video bit rate (in kilobit per second). A higher value means a higher quality."
												  "\nIf you have no idea where to start, try 5000 and change it if needed."));
		m_label_h264_crf = new QLabel(tr("Constant rate factor:", "libx264 setting: don't translate this unless you can come up with something sensible"), groupbox_video);
		m_slider_h264_crf = new QSlider(Qt::Horizontal, groupbox_video);
		m_slider_h264_crf->setRange(0, 51);
		m_slider_h264_crf->setSingleStep(1);
		m_slider_h264_crf->setPageStep(5);
		m_slider_h264_crf->setToolTip(tr("This setting changes the video quality. A lower value means a higher quality.\n"
										 "The allowed range is 0-51 (0 means lossless, the default is 23)."));
		m_label_h264_crf_value = new QLabel(groupbox_video);
		m_label_h264_crf_value->setNum(m_slider_h264_crf->value());
		m_label_h264_crf_value->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
		m_label_h264_crf_value->setMinimumWidth(QFontMetrics(m_label_h264_crf_value->font()).width("99") + 2);
		m_label_h264_preset = new QLabel(tr("Preset:", "libx264 setting: don't translate this unless you can come up with something sensible"), groupbox_video);
		m_combobox_h264_preset = new QComboBox(groupbox_video);
		for(unsigned int i = 0; i < H264_PRESET_COUNT; ++i) {
			m_combobox_h264_preset->addItem(EnumToString((enum_h264_preset) i));
		}
		m_combobox_h264_preset->setToolTip(tr("The encoding speed. A higher speed uses less CPU (making higher recording frame rates possible),\n"
											  "but results in larger files. The quality shouldn't be affected too much."));
		m_label_vp8_cpu_used = new QLabel(tr("CPU used:", "libvpx setting: don't translate this unless you can come up with something sensible"), groupbox_video);
		m_combobox_vp8_cpu_used = new QComboBox(groupbox_video);
		m_combobox_vp8_cpu_used->addItem("5 (" + tr("fastest") + ")");
		m_combobox_vp8_cpu_used->addItem("4");
		m_combobox_vp8_cpu_used->addItem("3");
		m_combobox_vp8_cpu_used->addItem("2");
		m_combobox_vp8_cpu_used->addItem("1");
		m_combobox_vp8_cpu_used->addItem("0 (" + tr("slowest") + ")");
		m_combobox_vp8_cpu_used->setToolTip(tr("The encoding speed. A higher value uses *less* CPU time. (I didn't choose the name, this is the name\n"
											   "used by the VP8 encoder). Higher values result in lower quality video, unless you increase the bit rate too."));
		m_label_video_options = new QLabel(tr("Custom options:"), groupbox_video);
		m_lineedit_video_options = new QLineEdit(groupbox_video);
		m_lineedit_video_options->setToolTip(tr("Custom codec options separated by commas (e.g. option1=value1,option2=value2,option3=value3)"));
		m_checkbox_video_allow_frame_skipping = new QCheckBox(tr("Allow frame skipping"), groupbox_video);
		m_checkbox_video_allow_frame_skipping->setToolTip(tr("If checked, the video encoder will be allowed to skip frames if the input frame rate is\n"
															 "lower than the output frame rate. If not checked, input frames will be duplicated to fill the holes.\n"
															 "This increases the file size and CPU usage, but reduces the latency for live streams in some cases.\n"
															 "It shouldn't affect the appearance of the video."));

		connect(m_combobox_video_codec, SIGNAL(activated(int)), this, SLOT(OnUpdateVideoCodecFields()));
		connect(m_slider_h264_crf, SIGNAL(valueChanged(int)), m_label_h264_crf_value, SLOT(setNum(int)));

		QGridLayout *layout = new QGridLayout(groupbox_video);
		layout->addWidget(label_video_codec, 0, 0);
		layout->addWidget(m_combobox_video_codec, 0, 1, 1, 2);
		layout->addWidget(m_label_video_codec_av, 1, 0);
		layout->addWidget(m_combobox_video_codec_av, 1, 1, 1, 2);
		layout->addWidget(m_label_video_kbit_rate, 2, 0);
		layout->addWidget(m_lineedit_video_kbit_rate, 2, 1, 1, 2);
		layout->addWidget(m_label_h264_crf, 3, 0);
		layout->addWidget(m_slider_h264_crf, 3, 1);
		layout->addWidget(m_label_h264_crf_value, 3, 2);
		layout->addWidget(m_label_h264_preset, 4, 0);
		layout->addWidget(m_combobox_h264_preset, 4, 1, 1, 2);
		layout->addWidget(m_label_vp8_cpu_used, 5, 0);
		layout->addWidget(m_combobox_vp8_cpu_used, 5, 1, 1, 2);
		layout->addWidget(m_label_video_options, 6, 0);
		layout->addWidget(m_lineedit_video_options, 6, 1, 1, 2);
		layout->addWidget(m_checkbox_video_allow_frame_skipping, 7, 0, 1, 3);
	}
	m_groupbox_audio = new QGroupBox(tr("Audio"));
	{
		QLabel *label_audio_codec = new QLabel(tr("Codec:"), m_groupbox_audio);
		m_combobox_audio_codec = new QComboBox(m_groupbox_audio);
		for(unsigned int i = 0; i < AUDIO_CODEC_COUNT; ++i) {
			m_combobox_audio_codec->addItem(m_audio_codecs[i].name);
		}
		m_combobox_audio_codec->setToolTip(tr("The codec that will be used to compress the audio stream. You shouldn't worry too much about\n"
											  "this, because the size of the audio data is usually negligible compared to the size of the video data.\n"
											  "And if you're only recording your own voice (i.e. no music), the quality won't matter that much anyway.\n"
											  "- Vorbis (libvorbis) is great, this is the recommended codec.\n"
											  "- MP3 (libmp3lame) is reasonably good.\n"
											  "- AAC is a good codec, but the implementations used here (libvo_aacenc or the experimental ffmpeg aac encoder)\n"
											  "   are pretty bad. Only use it if you have no other choice.\n"
											  "- Uncompressed will simply store the sound data without compressing it. The file will be quite large, but it's very fast."));
		m_label_audio_codec_av = new QLabel(tr("Codec name:"), m_groupbox_audio);
		m_combobox_audio_codec_av = new QComboBox(m_groupbox_audio);
		for(unsigned int i = 0; i < m_audio_codecs_av.size(); ++i) {
			AudioCodecData &c = m_audio_codecs_av[i];
			m_combobox_audio_codec_av->addItem(c.avname);
		}
		m_combobox_audio_codec_av->setToolTip(tr("For advanced users. You can use any libav/ffmpeg audio codec, but many of them are not useful or may not work."));
		m_label_audio_kbit_rate = new QLabel(tr("Bit rate (in kbps):"), m_groupbox_audio);
		m_lineedit_audio_kbit_rate = new QLineEdit(m_groupbox_audio);
		m_lineedit_audio_kbit_rate->setToolTip(tr("The audio bit rate (in kilobit per second). A higher value means a higher quality. The typical value is 128."));
		m_label_audio_options = new QLabel(tr("Custom options:"), m_groupbox_audio);
		m_lineedit_audio_options = new QLineEdit(m_groupbox_audio);
		m_lineedit_audio_options->setToolTip(tr("Custom codec options separated by commas (e.g. option1=value1,option2=value2,option3=value3)"));

		connect(m_combobox_audio_codec, SIGNAL(activated(int)), this, SLOT(OnUpdateAudioCodecFields()));

		QGridLayout *layout = new QGridLayout(m_groupbox_audio);
		layout->addWidget(label_audio_codec, 0, 0);
		layout->addWidget(m_combobox_audio_codec, 0, 1);
		layout->addWidget(m_label_audio_codec_av, 1, 0);
		layout->addWidget(m_combobox_audio_codec_av, 1, 1);
		layout->addWidget(m_label_audio_kbit_rate, 2, 0);
		layout->addWidget(m_lineedit_audio_kbit_rate, 2, 1);
		layout->addWidget(m_label_audio_options, 3, 0);
		layout->addWidget(m_lineedit_audio_options, 3, 1);
	}
	QPushButton *button_back = new QPushButton(g_icon_go_previous, tr("Back"), this);
	QPushButton *button_continue = new QPushButton(g_icon_go_next, tr("Continue"), this);

	connect(button_back, SIGNAL(clicked()), m_main_window, SLOT(GoPageInput()));
	connect(button_continue, SIGNAL(clicked()), this, SLOT(OnContinue()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(m_profile_box);
	layout->addWidget(groupbox_file);
	layout->addWidget(groupbox_video);
	layout->addWidget(m_groupbox_audio);
	layout->addStretch();
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addWidget(button_back);
		layout2->addWidget(button_continue);
	}

	OnUpdateContainerFields();
	OnUpdateVideoCodecFields();
	OnUpdateAudioCodecFields();

}
Beispiel #13
0
/*------------------------------------------------
   dialog procedure of this page
--------------------------------------------------*/
INT_PTR CALLBACK PageAnalogClockProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id, code;
			id = LOWORD(wParam); code = HIWORD(wParam);
			switch(id)
			{
				case IDC_ANALOGCLOCK:
					OnAnalogClock(hDlg);
					SendPSChanged(hDlg);
					break;
				case IDC_COLHOUR:
				case IDC_COLMIN:
					if(code == CBN_SELCHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_CHOOSECOLHOUR:
				case IDC_CHOOSECOLMIN:
					OnChooseColor(hDlg, id);
					break;
				case IDC_HOURHANDBOLD:
				case IDC_MINHANDBOLD:
				case IDC_ANALOGPOSLEFT:
				case IDC_ANALOGPOSRIGHT:
				case IDC_ANALOGPOSMIDDLE:
					SendPSChanged(hDlg);
					break;
				case IDC_ANALOGHPOS:
				case IDC_ANALOGVPOS:
				case IDC_ANALOGSIZE:
				case IDC_ANALOGBMP:
					if(code == EN_CHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_ANALOGBMPBROWSE:
					OnBrowse(hDlg);
					break;
			}
			return TRUE;
		}
		case WM_DRAWITEM:
			OnDrawItem(hDlg, (LPDRAWITEMSTRUCT)lParam);
			return TRUE;
		case WM_MEASUREITEM:
			// common/combobox.c
			OnMeasureItemColorCombo((LPMEASUREITEMSTRUCT)lParam);
			return TRUE;
		case WM_NOTIFY:
			switch(((NMHDR *)lParam)->code)
			{
				case PSN_APPLY: OnApply(hDlg); break;
				case PSN_HELP: MyHelp(GetParent(hDlg), "AnalogClock"); break;
			}
			return TRUE;
	}
	return FALSE;
}
void CRTFReaderTHDDlg::OnBrowse2() 
{
	OnBrowse(IDC_FILE2);
}
void CDialogFramesRecording::OnBnClickedButtonBrowsevideo()
{
	UpdateData(TRUE);                       // in case the user modified the editbox manually
	OnBrowse(m_strPathToVideoImageFiles,"Select a Folder for Output (video files)");
	UpdateData(FALSE);
}
Beispiel #16
0
/*------------------------------------------------
  Dialog procedure
--------------------------------------------------*/
INT_PTR CALLBACK PageMouseProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_DESTROY:
			OnDestroy(hDlg);
			break;
		case WM_COMMAND:
		{
			WORD id, code;
			id = LOWORD(wParam); code = HIWORD(wParam);
			switch(id)
			{
				case IDC_NAMECLICK:
					if(code == CBN_SELCHANGE)
					{
						m_bInit = FALSE;
						OnName(hDlg);
						m_bInit = TRUE;
					}
					else if(code == CBN_DROPDOWN)
						OnNameDropDown(hDlg);
					else if(code == CBN_EDITCHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_ADDCLICK:
					OnAdd(hDlg);
					break;
				case IDC_DELCLICK:
					OnDelete(hDlg);
					break;
				case IDC_MOUSEBUTTON:
					if(code == CBN_SELCHANGE)
					{
#if TC_ENABLE_WHEEL
						OnMouseButton(hDlg);
#endif
						SendPSChanged(hDlg);
					}
					break;
				case IDC_RADSINGLE:
				case IDC_RADDOUBLE:
				case IDC_RADTRIPLE:
				case IDC_RADQUADRUPLE:
				case IDC_MOUSECTRL:
				case IDC_MOUSESHIFT:
				case IDC_MOUSEALT:
				case IDC_RCLICKMENU:
					SendPSChanged(hDlg);
					break;
				case IDC_LMOUSEPASSTHRU:
					g_bApplyClock = TRUE;
					SendPSChanged(hDlg);
					break;
				case IDC_MOUSEFUNC:
					OnFunction(hDlg, TRUE);
					break;
				case IDC_MOUSEOPT:
					if(code == EN_CHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_MOUSEOPTSANSHO:
					OnBrowse(hDlg);
					break;
			}
			return TRUE;
		}
		case WM_NOTIFY:
			switch(((NMHDR *)lParam)->code)
			{
				case PSN_APPLY: OnApply(hDlg); break;
				case PSN_HELP: MyHelp(GetParent(hDlg), "Mouse"); break;
			}
			return TRUE;
	}
	return FALSE;
}