Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2006, 12:50:11 AM (18 years ago)
Author:
bensch
Message:

added GuiAudio

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/qt_gui/gui_audio.cc

    r7493 r7495  
    2525
    2626
    27 #include "gui_video.h"
     27#include "gui_audio.h"
    2828
    2929#include <qlayout.h>
     
    3838{
    3939  /**
    40    *  Creates the Video-Option-Frame
     40   *  Creates the Audio-Option-Frame
    4141  */
    42   GuiVideo::GuiVideo(QWidget* parent)
    43   : Element("Video"), QGroupBox(parent)
     42  GuiAudio::GuiAudio(QWidget* parent)
     43  : Element("Audio"), QGroupBox(parent)
    4444  {
    4545    QGridLayout* layout = new QGridLayout(this);
    4646
    4747    {
    48       QCheckBox* fullscreen = new QCheckBox(QString("FullScreen"), this);
     48      QCheckBox* fullscreen = new QCheckBox(QString("Enabled"), this);
    4949      //fullscreen->setName();
    5050      layout->addWidget(fullscreen, 0, 0);
    5151
    52       QCheckBox* wireframe = new QCheckBox("Wireframe mode", this);
     52      QCheckBox* wireframe = new QCheckBox("Test", this);
    5353      layout->addWidget(wireframe, 1, 0);
    5454
    55       QComboBox* resolution = new QComboBox("Resolution", this);
     55      QComboBox* resolution = new QComboBox("SecondTest", this);
    5656      layout->addWidget(resolution, 2, 0);
    5757
     
    6060
    6161
    62 
    63 /*    Frame* videoFrame;        //!< The Frame that holds the video options.
    64 
    65     videoFrame = new Frame("Video-Options:");
    66     videoFrame->setGroupName("video");
    67     {
    68       Box* videoBox;            //!< The Box that holds the video options.
    69 
    70       videoBox = new Box('v');
    71       {
    72         CheckButton* fullscreen;  //!< CheckButton for fullscreen-mode
    73         Menu* resolution;         //!< Menu for the resolution
    74         CheckButton* wireframe;   //!< CheckButton for wireframe Mode.
    75 
    76         fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN);
    77         fullscreen->setFlagName("windowed", "q", 1);
    78         fullscreen->setDescription("Starts orxonox in windowed mode");
    79         fullscreen->saveability();
    80         videoBox->fill(fullscreen);
    81         resolution = new Menu(CONFIG_NAME_RESOLUTION);
    82         getResolutions(resolution);
    83         resolution->saveability();
    84         resolution->setFlagName("resolution", "r", 0);
    85         resolution->setDescription("Sets the resolution of orxonox");
    86         videoBox->fill(resolution);
    87         wireframe = new CheckButton(CONFIG_NAME_WIREFRAME);
    88         wireframe->setFlagName("wireframe", "w", 0);
    89         wireframe->setDescription("Starts orxonox in wireframe mode");
    90         wireframe->saveability();
    91         videoBox->fill(wireframe);
    92 
    93         videoBox->fill(advancedWindowCreate());
    94       }
    95       videoFrame->fill(videoBox);
    96     }
    97     setMainWidget(videoFrame);*/
    9862  }
    9963
    10064  /**
    101    *  Destructs the Video-stuff
     65   *  Destructs the Audio-stuff
    10266  */
    103   GuiVideo::~GuiVideo()
     67  GuiAudio::~GuiAudio()
    10468  {
    10569    // nothing to do here.
    10670  }
    10771
    108   /**
    109    *  sets all resolutions to the menu
    110    * @param menu the Menu to set The resolutions to.
    111   */
    112   void GuiVideo::getResolutions(std::vector<std::string>& resolutionList)
    113   {
    114     SDL_Init(SDL_INIT_VIDEO);
    115     SDL_Rect **modes;
    116     int i;
    117     int x = 0,y =0; // check for difference
    118     char tmpChar[100];
    119 
    120     /* Get available fullscreen/hardware modes */
    121     modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
    122 
    123     /* Check is there are any modes available */
    124     if(modes == (SDL_Rect **)0)
    125     {
    126       PRINTF(2)("No video-modes available!\n");
    127       exit(-1);
    128     }
    129 
    130     /* Check if our resolution is restricted */
    131     if(modes == (SDL_Rect **)-1)
    132     {
    133       PRINTF(2)("All resolutions available.\n");
    134     }
    135     else
    136     {
    137       /* Print valid modes */
    138       PRINT(5)("Available Modes\n");
    139       for(i = 0; modes[i] ;++i)
    140       {
    141         if (x != modes[i]->w || y != modes[i]->h)
    142         {
    143           PRINTF(5)("  %d x %d\n", modes[i]->w, modes[i]->h);
    144           sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h);
    145           resolutionList.push_back(std::string(tmpChar));
    146           x = modes[i]->w; y = modes[i]->h;
    147         }
    148       }
    149     }
    150     SDL_QuitSubSystem(SDL_INIT_VIDEO);
    151     SDL_Quit();
    152   }
    15372
    15473}
Note: See TracChangeset for help on using the changeset viewer.