Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7495 in orxonox.OLD


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

added GuiAudio

Location:
branches/qt_gui/src/lib/gui/qt_gui
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/qt_gui/Makefile.am

    r7489 r7495  
    1717                qt_gui.cc \
    1818                \
    19                 gui_video.cc
     19                gui_video.cc \
     20                gui_audio.cc
    2021
    2122noinst_HEADERS= \
    2223                qt_gui.h \
    2324                \
    24                 gui_video.h
     25                gui_video.h \
     26                gui_audio.h
    2527
    2628EXTRA_DIST =
  • 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}
  • branches/qt_gui/src/lib/gui/qt_gui/gui_audio.h

    r7493 r7495  
    11/*!
    2   \file gui_video.h
    3   \brief File that holds the class that creates the Video-Options.
     2  \file gui_audio.h
     3  \brief File that holds the class that creates the Audio-Options.
    44*/
    5 #ifndef _GUI_VIDEO_H
    6 #define _GUI_VIDEO_H
     5#ifndef _GUI_AUDIO_H
     6#define _GUI_AUDIO_H
    77
    88#include "../gui_element.h"
     
    1313namespace OrxGui
    1414{
    15   //! Class that creates the Video-Options.
    16   class GuiVideo : public OrxGui::Element, public QGroupBox
     15  //! Class that creates the Audio-Options.
     16  class GuiAudio : public OrxGui::Element, public QGroupBox
    1717  {
    1818  public:
    19     GuiVideo(QWidget* parent = NULL);
    20     virtual ~GuiVideo();
     19    GuiAudio(QWidget* parent = NULL);
     20    virtual ~GuiAudio();
    2121
    22   private:
    23     void getResolutions(std::vector<std::string>& resolutionList);
    2422  };
    2523}
    2624
    27 #endif /* _GUI_VIDEO_H */
     25#endif /* _GUI_AUDIO_H */
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc

    r7493 r7495  
    2626
    2727#include "gui_video.h"
     28#include "gui_audio.h"
    2829
    2930namespace OrxGui
     
    4344
    4445        toolBox->addItem(new GuiVideo(toolBox), "Video");
     46        toolBox->addItem(new GuiAudio(toolBox), "Audio");
    4547      }
    4648      mainLayout->addWidget(toolBox,1,1);
Note: See TracChangeset for help on using the changeset viewer.