コード例 #1
0
ファイル: videopreview.cpp プロジェクト: buscher/SMPlayer2
bool VideoPreview::showConfigDialog(QWidget *parent)
{
    VideoPreviewConfigDialog d(parent);

    d.setVideoFile(videoFile());
    d.setDVDDevice(DVDDevice());
    d.setCols(cols());
    d.setRows(rows());
    d.setInitialStep(initialStep());
    d.setMaxWidth(maxWidth());
    d.setDisplayOSD(displayOSD());
    d.setAspectRatio(aspectRatio());
    d.setFormat(extractFormat());
    d.setSaveLastDirectory(save_last_directory);

    if (d.exec() == QDialog::Accepted) {
        setVideoFile(d.videoFile());
        setDVDDevice(d.DVDDevice());
        setCols(d.cols());
        setRows(d.rows());
        setInitialStep(d.initialStep());
        setMaxWidth(d.maxWidth());
        setDisplayOSD(d.displayOSD());
        setAspectRatio(d.aspectRatio());
        setExtractFormat(d.format());
        save_last_directory = d.saveLastDirectory();

        return true;
    }

    return false;
}
コード例 #2
0
ファイル: prefdrives.cpp プロジェクト: kitech/smplayer
void PrefDrives::updateDriveCombos(bool detect_cd_devices) {
    qDebug("PrefDrives::updateDriveCombos: detect_cd_devices: %d", detect_cd_devices);

    // Save current values
    QString current_dvd_device = dvdDevice();
    QString current_cd_device = cdromDevice();
#ifdef BLURAY_SUPPORT
    QString current_bluray_device = blurayDevice();
#endif

    dvd_device_combo->clear();
    cdrom_device_combo->clear();
#ifdef BLURAY_SUPPORT
    bluray_device_combo->clear();
#endif

    // DVD device combo
    // In windows, insert the drives letters
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    QFileInfoList list = QDir::drives();
    for (int n = 0; n < list.size(); n++) {
        QString s = list[n].filePath();
        bool is_cd_device = true;
        if (detect_cd_devices) is_cd_device = isCDDevice(s);
        if (is_cd_device) {
            if (s.endsWith("/")) s = s.remove( s.length()-1,1);
            dvd_device_combo->addItem( s );
            cdrom_device_combo->addItem( s );
#ifdef BLURAY_SUPPORT
            bluray_device_combo->addItem( s );
#endif
        }
    }
#else
    QDir dev_dir("/dev");
    QStringList devices = dev_dir.entryList( QStringList() << "dvd*" << "cdrom*" << "cdrw*" << "sr*" << "cdrecorder*" << "acd[0-9]*" << "cd[0-9]*",
                          QDir::Files | QDir::System | QDir::Readable);
    for (int n=0; n < devices.count(); n++) {
        QString device_name = "/dev/" + devices[n];
        qDebug("PrefDrives::PrefDrives: device found: '%s'", device_name.toUtf8().constData());
        dvd_device_combo->addItem(device_name);
        cdrom_device_combo->addItem(device_name);
#ifdef BLURAY_SUPPORT
        bluray_device_combo->addItem(device_name);
#endif
    }
#endif

    // Restore previous values
    setDVDDevice( current_dvd_device );
    setCDRomDevice( current_cd_device );
#ifdef BLURAY_SUPPORT
    setBlurayDevice( current_bluray_device );
#endif
}
コード例 #3
0
ファイル: prefdrives.cpp プロジェクト: kitech/smplayer
void PrefDrives::setData(Preferences * pref) {
    setDVDDevice( pref->dvd_device );
    setCDRomDevice( pref->cdrom_device );
#ifdef BLURAY_SUPPORT
    setBlurayDevice( pref->bluray_device );
#endif

#if DVDNAV_SUPPORT
    setUseDVDNav( pref->use_dvdnav );
#endif
}
コード例 #4
0
ファイル: videopreview.cpp プロジェクト: buscher/SMPlayer2
void VideoPreview::loadSettings()
{
    qDebug("VideoPreview::loadSettings");

    set->beginGroup("videopreview");

    setCols(set->value("columns", cols()).toInt());
    setRows(set->value("rows", rows()).toInt());
    setInitialStep(set->value("initial_step", initialStep()).toInt());
    setMaxWidth(set->value("max_width", maxWidth()).toInt());
    setDisplayOSD(set->value("osd", displayOSD()).toBool());
    setExtractFormat((ExtractFormat) set->value("format", extractFormat()).toInt());
    save_last_directory = set->value("save_last_directory", save_last_directory).toBool();
    last_directory = set->value("last_directory", last_directory).toString();

    setVideoFile(set->value("filename", videoFile()).toString());
    setDVDDevice(set->value("dvd_device", DVDDevice()).toString());

    toggleInfoAct->setChecked(set->value("show_info", true).toBool());

    set->endGroup();
}