int DIA_getLameSettings(ADM_audioEncoderDescriptor *descriptor)
  {
    int ret=0;
    char string[400];
    uint32_t mmode,ppreset;
#define SZT(x) sizeof(x)/sizeof(diaMenuEntry )
#define PX(x) &(lameParam->x)
    
    
    LAME_encoderParam *lameParam;
    ADM_assert(sizeof(LAME_encoderParam)==descriptor->paramSize);
  
    lameParam=(LAME_encoderParam*)descriptor->param;
    mmode=lameParam->mode;
    ppreset=lameParam->preset;
    diaMenuEntry channelMode[]={
                             {ADM_STEREO,      QT_TR_NOOP("Stereo"),NULL},
                             {ADM_JSTEREO,   QT_TR_NOOP("Joint stereo"),NULL},
                             {ADM_MONO,      QT_TR_NOOP("Mono"),NULL}};
          
    diaElemMenu menuMode(&mmode,   QT_TR_NOOP("C_hannel mode:"), SZT(channelMode),channelMode);
    
    diaMenuEntry encodingMode[]={
                             {ADM_LAME_PRESET_CBR,      QT_TR_NOOP("CBR"),NULL},
                             {ADM_LAME_PRESET_ABR,   QT_TR_NOOP("ABR"),NULL},
#if 0
                             {ADM_LAME_PRESET_EXTREME,      QT_TR_NOOP("Extreme"),NULL}
#endif
    }; 
    diaElemMenu Mode(&ppreset,   QT_TR_NOOP("Bit_rate mode:"), SZT(encodingMode),encodingMode);
#define BITRATE(x) {x,QT_TR_NOOP(#x)}
    diaMenuEntry bitrateM[]={
                              BITRATE(56),
                              BITRATE(64),
                              BITRATE(80),
                              BITRATE(96),
                              BITRATE(112),
                              BITRATE(128),
                              BITRATE(160),
                              BITRATE(192),
                              BITRATE(224)
                          };
    diaElemMenu bitrate(&(descriptor->bitrate),   QT_TR_NOOP("_Bitrate:"), SZT(bitrateM),bitrateM);
    
    
    
    
    diaElemUInteger quality(PX(quality),QT_TR_NOOP("_Quality:"),0,9);
    diaElemToggle reservoir(PX(disableReservoir),QT_TR_NOOP("_Disable reservoir:"));
  
      diaElem *elems[]={&menuMode,&Mode,&quality,&bitrate,&reservoir};
    
  if( diaFactoryRun(QT_TR_NOOP("LAME Configuration"),5,elems))
  {
    lameParam->mode=(ADM_mode)mmode; 
    lameParam->preset=(ADM_LAME_PRESET)ppreset;
    return 1;
  }
  return 0;
}  
bool configure(CONFcouple **setup)
{

    uint32_t mmode,ppreset;
    ELEM_TYPE_FLOAT qqual;

    vorbis_encoder config=defaultConfig;
    if(*setup)
    {
        ADM_paramLoad(*setup,vorbis_encoder_param,&config);
    }


    mmode=config.mode;
    qqual=(ELEM_TYPE_FLOAT)config.quality;

    diaMenuEntry channelMode[]={
                             {ADM_VORBIS_VBR,      QT_TRANSLATE_NOOP("vorbis","VBR"),NULL},
                             {ADM_VORBIS_QUALITY,   QT_TRANSLATE_NOOP("vorbis","Quality based"),NULL}};

    diaElemMenu menuMode(&mmode,   QT_TRANSLATE_NOOP("vorbis","_Mode:"), SZT(channelMode),channelMode);


    diaMenuEntry bitrateM[]={
                              BITRATE(56),
                              BITRATE(64),
                              BITRATE(80),
                              BITRATE(96),
                              BITRATE(112),
                              BITRATE(128),
                              BITRATE(160),
                              BITRATE(192),
                              BITRATE(224)
                          };
    diaElemMenu bitrate(&(config.bitrate),   QT_TRANSLATE_NOOP("vorbis","_Bitrate:"), SZT(bitrateM),bitrateM);

    diaElemFloat quality(&qqual,QT_TRANSLATE_NOOP("vorbis","_Quality:"),-1.,10.);




      diaElem *elems[]={&menuMode,&bitrate,&quality};

  if( diaFactoryRun(QT_TRANSLATE_NOOP("vorbis","Vorbis Configuration"),3,elems))
  {
    config.mode=(ADM_VORBIS_MODE)mmode;
    config.quality=(float)qqual;
    if(*setup) delete *setup;
    *setup=NULL;
    ADM_paramSave(setup,vorbis_encoder_param,&config);
    defaultConfig=config;
    return 1;
  }
  return 0;
}
int DIA_getVorbisSettings(ADM_audioEncoderDescriptor *descriptor)
  {
    int ret=0;
    char string[400];
    uint32_t mmode,ppreset;
    ELEM_TYPE_FLOAT qqual;
#define SZT(x) sizeof(x)/sizeof(diaMenuEntry )
#define PX(x) &(lameParam->x)
    
    
   VORBIS_encoderParam *vorbisParam;
  ADM_assert(sizeof(VORBIS_encoderParam)==descriptor->paramSize);
  vorbisParam=(VORBIS_encoderParam*)descriptor->param;
  
    mmode=vorbisParam->mode;
    qqual=(ELEM_TYPE_FLOAT)vorbisParam->quality;
    
    diaMenuEntry channelMode[]={
                             {ADM_VORBIS_VBR,      QT_TR_NOOP("VBR"),NULL},
                             {ADM_VORBIS_QUALITY,   QT_TR_NOOP("Quality based"),NULL}};
          
    diaElemMenu menuMode(&mmode,   QT_TR_NOOP("_Mode:"), SZT(channelMode),channelMode);
    
#define BITRATE(x) {x,QT_TR_NOOP(#x)}
    diaMenuEntry bitrateM[]={
                              BITRATE(56),
                              BITRATE(64),
                              BITRATE(80),
                              BITRATE(96),
                              BITRATE(112),
                              BITRATE(128),
                              BITRATE(160),
                              BITRATE(192),
                              BITRATE(224)
                          };
    diaElemMenu bitrate(&(descriptor->bitrate),   QT_TR_NOOP("_Bitrate:"), SZT(bitrateM),bitrateM);
    
    diaElemFloat quality(&qqual,QT_TR_NOOP("_Quality:"),-1.,10.);
    
    
    
  
      diaElem *elems[]={&menuMode,&bitrate,&quality};
    
  if( diaFactoryRun(QT_TR_NOOP("Vorbis Configuration"),3,elems))
  {
    vorbisParam->mode=(ADM_VORBIS_MODE)mmode;
    vorbisParam->quality=(float)qqual;
    
    return 1;
  }
  return 0;
}  
Esempio n. 4
0
    //__________________________________________________________________
    void StyleConfig::updateChanged()
    {

        bool modified( false );

        // check if any value was modified
        if ( _toolBarDrawItemSeparator->isChecked() != StyleConfigData::toolBarDrawItemSeparator() ) modified = true;
        else if( _mnemonicsMode->currentIndex() != StyleConfigData::mnemonicsMode() ) modified = true;
        else if( _viewDrawTriangularExpander->isChecked() != StyleConfigData::viewDrawTriangularExpander() ) modified = true;
        else if( _viewDrawFocusIndicator->isChecked() != StyleConfigData::viewDrawFocusIndicator() ) modified = true;
        else if( _viewDrawTreeBranchLines->isChecked() != StyleConfigData::viewDrawTreeBranchLines() ) modified = true;
        else if( _scrollBarWidth->value() != StyleConfigData::scrollBarWidth() ) modified = true;
        else if( _scrollBarAddLineButtons->currentIndex() != StyleConfigData::scrollBarAddLineButtons() ) modified = true;
        else if( _scrollBarSubLineButtons->currentIndex() != StyleConfigData::scrollBarSubLineButtons() ) modified = true;
        else if( _splitterProxyEnabled->isChecked() != StyleConfigData::splitterProxyEnabled() ) modified = true;
        else if( (_checkDrawX->isChecked() ? StyleConfigData::CS_X : StyleConfigData::CS_CHECK) != StyleConfigData::checkBoxStyle() ) modified = true;
        else if( menuMode() != StyleConfigData::menuHighlightMode() ) modified = true;
        else if( tabStyle() != StyleConfigData::tabStyle() ) modified = true;
        else if( _animationsEnabled->isChecked() != StyleConfigData::animationsEnabled() ) modified = true;
        else if( _cacheEnabled->isChecked() != StyleConfigData::cacheEnabled() ) modified = true;
        else if( _useWMMoveResize->isChecked() != StyleConfigData::useWMMoveResize() ) modified = true;
        else if( triangularExpanderSize() != StyleConfigData::viewTriangularExpanderSize() ) modified = true;
        else if( _animationConfigWidget && _animationConfigWidget->isChanged() ) modified = true;

        if( !modified )
        {
            switch( _windowDragMode->currentIndex() )
            {
                case 0:
                {
                    if( StyleConfigData::windowDragEnabled() ) modified = true;
                    break;
                }

                case 1:
                case 2:
                default:
                {
                    if( !StyleConfigData::windowDragEnabled() || windowDragMode() != StyleConfigData::windowDragMode() )
                    { modified = true; }
                    break;
                }

            }
        }

        emit changed(modified);

    }
Esempio n. 5
0
    //__________________________________________________________________
    void StyleConfig::save( void )
    {
        StyleConfigData::setToolBarDrawItemSeparator( _toolBarDrawItemSeparator->isChecked() );
        StyleConfigData::setCheckBoxStyle( ( _checkDrawX->isChecked() ? StyleConfigData::CS_X : StyleConfigData::CS_CHECK ) );
        StyleConfigData::setSplitterProxyEnabled( _splitterProxyEnabled->isChecked() );
        StyleConfigData::setMnemonicsMode( _mnemonicsMode->currentIndex() );
        StyleConfigData::setCacheEnabled( _cacheEnabled->isChecked() );
        StyleConfigData::setViewDrawTriangularExpander( _viewDrawTriangularExpander->isChecked() );
        StyleConfigData::setViewTriangularExpanderSize( triangularExpanderSize() );
        StyleConfigData::setViewDrawFocusIndicator( _viewDrawFocusIndicator->isChecked() );
        StyleConfigData::setViewDrawTreeBranchLines( _viewDrawTreeBranchLines->isChecked() );
        StyleConfigData::setScrollBarWidth( _scrollBarWidth->value() );
        StyleConfigData::setScrollBarAddLineButtons( _scrollBarAddLineButtons->currentIndex() );
        StyleConfigData::setScrollBarSubLineButtons( _scrollBarSubLineButtons->currentIndex() );
        StyleConfigData::setMenuHighlightMode( menuMode() );
        StyleConfigData::setTabStyle( tabStyle() );
        StyleConfigData::setViewTriangularExpanderSize( triangularExpanderSize() );

        if( _expertMode )
        {

            _animationConfigWidget->save();

        } else {

            StyleConfigData::setAnimationsEnabled( _animationsEnabled->isChecked() );

        }

        StyleConfigData::setUseWMMoveResize( _useWMMoveResize->isChecked() );
        if( _windowDragMode->currentIndex() == 0 )
        {

            StyleConfigData::setWindowDragEnabled( false  );

        } else {

            StyleConfigData::setWindowDragEnabled( true  );
            StyleConfigData::setWindowDragMode( windowDragMode()  );

        }

        StyleConfigData::self()->writeConfig();

        // emit dbus signal
        QDBusMessage message( QDBusMessage::createSignal("/OxygenStyle",  "org.kde.Oxygen.Style", "reparseConfiguration") );
        QDBusConnection::sessionBus().send(message);

    }
uint8_t configure(void)
{
    
    uint32_t mmode,ppreset;
    ELEM_TYPE_FLOAT qqual;
    
    
   VORBIS_encoderParam *vParam=&vorbisParam;
  
    mmode=vParam->mode;
    qqual=(ELEM_TYPE_FLOAT)vParam->quality;
    
    diaMenuEntry channelMode[]={
                             {ADM_VORBIS_VBR,      QT_TR_NOOP("VBR"),NULL},
                             {ADM_VORBIS_QUALITY,   QT_TR_NOOP("Quality based"),NULL}};
          
    diaElemMenu menuMode(&mmode,   QT_TR_NOOP("_Mode:"), SZT(channelMode),channelMode);
    

    diaMenuEntry bitrateM[]={
                              BITRATE(56),
                              BITRATE(64),
                              BITRATE(80),
                              BITRATE(96),
                              BITRATE(112),
                              BITRATE(128),
                              BITRATE(160),
                              BITRATE(192),
                              BITRATE(224)
                          };
    diaElemMenu bitrate(&(vParam->bitrate),   QT_TR_NOOP("_Bitrate:"), SZT(bitrateM),bitrateM);
    
    diaElemFloat quality(&qqual,QT_TR_NOOP("_Quality:"),-1.,10.);
    
    
    
  
      diaElem *elems[]={&menuMode,&bitrate,&quality};
    
  if( diaFactoryRun(QT_TR_NOOP("Vorbis Configuration"),3,elems))
  {
    vParam->mode=(ADM_VORBIS_MODE)mmode;
    vParam->quality=(float)qqual;
    return 1;
  }
  return 0;
}  
Esempio n. 7
0
/**
    \fn configure
*/
bool Decimate::configure(void)
{
	deciMate *_param=&configuration;
#define PX(x) &(configuration.x)
#define SZT(x) sizeof(x)/sizeof(diaMenuEntry *)
        
    ELEM_TYPE_FLOAT t1=(ELEM_TYPE_FLOAT)_param->threshold;
    ELEM_TYPE_FLOAT t2=(ELEM_TYPE_FLOAT)_param->threshold2;

         diaMenuEntry tMode[]={
                             {0, QT_TR_NOOP("Discard closer"),NULL},
                             {1, QT_TR_NOOP("Replace (interpolate)"),NULL},
                             {2, QT_TR_NOOP("Discard longer dupe (animés)"),NULL},
                             {3, QT_TR_NOOP("Pulldown dupe removal"),NULL}
                          };
         diaMenuEntry tQuality[]={
                             {0, QT_TR_NOOP("Fastest (no chroma, partial luma)"),NULL},
//                             {1, QT_TR_NOOP("Fast (partial luma and chroma)"),NULL},
                             {2, QT_TR_NOOP("Medium (full luma, no chroma)"),NULL},
//                             {3, QT_TR_NOOP("Slow (full luma and chroma)"),NULL}
                          };
  
    
    diaElemMenu menuMode(PX(mode),QT_TR_NOOP("_Mode:"), 4,tMode);
    diaElemMenu menuQuality(PX(quality),QT_TR_NOOP("_Quality:"), sizeof(tQuality)/sizeof(diaMenuEntry),tQuality);
    diaElemFloat menuThresh1(&t1,QT_TR_NOOP("_Threshold 1:"),0,100.);
    diaElemFloat menuThresh2(&t2,QT_TR_NOOP("T_hreshold 2:"),0,100.);
    diaElemUInteger cycle(PX(cycle),QT_TR_NOOP("C_ycle:"),2,40);
    diaElemToggle show(PX(show),QT_TR_NOOP("Sho_w"));
    diaElem *elems[]={&cycle,&menuMode,&menuQuality,&menuThresh1,&menuThresh2,&show};
    
  if(diaFactoryRun(QT_TR_NOOP("Decomb Decimate"),6,elems))
  {
    _param->threshold=(double )t1;
    _param->threshold2=(double )t2;
    updateInfo();
    reset();
    return 1; 
  }
  return 0;        
}
uint8_t Decimate::configure(AVDMGenericVideoStream *in)
{
	_in=in;
#define PX(x) &(_param->x)
#define SZT(x) sizeof(x)/sizeof(diaMenuEntry *)
        
    ELEM_TYPE_FLOAT t1=(ELEM_TYPE_FLOAT)_param->threshold;
    ELEM_TYPE_FLOAT t2=(ELEM_TYPE_FLOAT)_param->threshold2;

         diaMenuEntry tMode[]={
                             {0, QT_TR_NOOP("Discard closer"),NULL},
                             {1, QT_TR_NOOP("Replace (interpolate)"),NULL},
                             {2, QT_TR_NOOP("Discard longer dupe (animés)"),NULL},
                             {3, QT_TR_NOOP("Pulldown dupe removal"),NULL}
                          };
         diaMenuEntry tQuality[]={
                             {0, QT_TR_NOOP("Fastest (no chroma, partial luma)"),NULL},
                             {1, QT_TR_NOOP("Fast (partial luma and chroma)"),NULL},
                             {2, QT_TR_NOOP("Medium (full luma, no chroma)"),NULL},
                             {3, QT_TR_NOOP("Slow (full luma and chroma)"),NULL}
                          };
  
    
    diaElemMenu menuMode(PX(mode),QT_TR_NOOP("_Mode:"), 4,tMode);
    diaElemMenu menuQuality(PX(quality),QT_TR_NOOP("_Quality:"), 4,tQuality);
    diaElemFloat menuThresh1(&t1,QT_TR_NOOP("_Threshold 1:"),0,100.);
    diaElemFloat menuThresh2(&t2,QT_TR_NOOP("T_hreshold 2:"),0,100.);
    diaElemUInteger cycle(PX(cycle),QT_TR_NOOP("C_ycle:"),2,40);
    
    diaElem *elems[]={&cycle,&menuMode,&menuQuality,&menuThresh1,&menuThresh2};
    
  if(diaFactoryRun(QT_TR_NOOP("Decomb Decimate"),5,elems))
  {
    _param->threshold=(double )t1;
    _param->threshold2=(double )t2;
    return 1; 
  }
  return 0;        
        
        
}