Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9019 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jul 2, 2006, 4:41:32 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: OggPlayer retrieves Information about the current Title
The Title Played is relayed to the Hud's Notifier

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl/glgui_widget.cc

    r8990 r9019  
    116116    this->_style[3]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    117117
    118     this->setForegroundColor(Color(1, 0, 0, 1), OrxGui::Normal);
    119     this->setForegroundColor(Color(0, 0, 1, 1), OrxGui::Selected);
    120     this->setForegroundColor(Color(0, 1, 0, 1), OrxGui::Focused);
     118    this->setForegroundColor(Color(.8, .8, 1, 1), OrxGui::Normal);
     119    this->setForegroundColor(Color(0, .4, 1.0, 1), OrxGui::Selected);
     120    this->setForegroundColor(Color(0, .0, 1.0, 1), OrxGui::Focused);
    121121    this->setForegroundColor(Color(.1, .1, .1, 1), OrxGui::Insensitive);
    122122
  • trunk/src/lib/sound/ogg_player.cc

    r8362 r9019  
    3232#include "debug.h"
    3333#include "compiler.h"
     34
     35#include "helper_functions.h"
    3436
    3537#ifdef HAVE_SDL_SDL_H
     
    137139    vorbisInfo = ov_info(&oggStream, -1);
    138140    vorbisComment = ov_comment(&oggStream, -1);
     141    this->retrieveFileInfo(&oggStream);
    139142
    140143    if(vorbisInfo->channels == 1)
     
    469472      alSourceUnqueueBuffers(source, 1, &buffer);
    470473      SoundEngine::checkError("OggPlayer::empty()::unqueue Buffers", __LINE__);
     474    }
     475  }
     476
     477
     478  void OggPlayer::retrieveFileInfo(OggVorbis_File* file)
     479  {
     480    vorbis_comment* comment = ov_comment(file, -1);
     481    if (comment == NULL)
     482    {
     483      PRINTF(2)("Retrieving Comment of %s failed\n", this->getName());
     484      return;
     485    }
     486    for (int i = 0; i < comment->comments; ++i)
     487    {
     488      if (!nocaseCmp("artist=", comment->user_comments[i], 7))
     489        this->_artist = comment->user_comments[i]+7;
     490      if (!nocaseCmp("title=", comment->user_comments[i], 6))
     491        this->_title = comment->user_comments[i] + 6;
     492      if (!nocaseCmp("album=", comment->user_comments[i], 6))
     493        this->_album = comment->user_comments[i]+6;
    471494    }
    472495  }
  • trunk/src/lib/sound/ogg_player.h

    r7737 r9019  
    5959    bool getState() { return this->state; };
    6060
     61    const std::string& artist() const { return this->_artist; };
     62    const std::string& title() const { return this->_title; };
     63    const std::string& album() const { return this->_album; };
     64
     65
    6166    void debug() const;
    6267    void printState() const;
     
    7580    void empty();
    7681
     82    void retrieveFileInfo(OggVorbis_File* file);
     83
    7784  private:
    7885    FILE*               oggFile;              //!< general file-handler, to open the sound-file
     
    8895    SDL_Thread*         musicThreadID;        //!< The Thread in which music is Played back.
    8996    OrxThread::Mutex    musicMutex;           //!< A Mutex so that the two threads do not interfere.
     97
     98
     99
     100    std::string         _title;
     101    std::string         _artist;
     102    std::string         _album;
     103    std::string         _vendor;
    90104  };
    91105
  • trunk/src/story_entities/game_world_data.cc

    r8975 r9019  
    389389    std::string oggFile = ResourceManager::getFullName(name);
    390390    this->music = new OrxSound::OggPlayer(oggFile);
     391    if (this->localPlayer != NULL)
     392      this->localPlayer->hud().notifyUser(std::string("Playing SoundTrack: ") + this->music->artist() + " - " + this->music->title());
    391393
    392394    //(OggPlayer*)ResourceManager::getInstance()->load(name, OGG, RP_LEVEL);
  • trunk/src/world_entities/elements/glgui_radar.cc

    r9014 r9019  
    4242    this->setBackgroundTexture("gui_radar.png");
    4343
    44     this->_updateInterval = 1.0f;
     44    this->_updateInterval = .01f;
    4545    this->_timePassed = 0.0f;
    4646    this->_range = 100.0f;
     
    9494    _timePassed+=dt;
    9595
    96     //if (_timePassed > _updateInterval)
     96    if (_timePassed > _updateInterval)
    9797    {
    9898      _timePassed = 0 ; //-=_updateInterval;
  • trunk/src/world_entities/environments/mapped_water.cc

    r9006 r9019  
    351351      OrxGui::GLGuiBox* waterColorBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    352352      {
    353         OrxGui::GLGuiInputLine* waterColorText = new OrxGui::GLGuiInputLine();
     353        OrxGui::GLGuiText* waterColorText = new OrxGui::GLGuiText();
    354354        waterColorText->setText("WaterColor");
    355355        waterColorBox->pack(waterColorText);
     
    380380      OrxGui::GLGuiBox* waterUVBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    381381      {
    382         OrxGui::GLGuiInputLine* waterUVText = new OrxGui::GLGuiInputLine();
     382        OrxGui::GLGuiText* waterUVText = new OrxGui::GLGuiText();
    383383        waterUVText->setText("WaterUV");
    384384        waterUVBox->pack(waterUVText);
     
    395395      OrxGui::GLGuiBox* waterFlowBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    396396      {
    397         OrxGui::GLGuiInputLine* waterFlowText = new OrxGui::GLGuiInputLine();
     397        OrxGui::GLGuiText* waterFlowText = new OrxGui::GLGuiText();
    398398        waterFlowText->setText("WaterFlow");
    399399        waterFlowBox->pack(waterFlowText);
     
    410410      OrxGui::GLGuiBox* shineSizeBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    411411      {
    412         OrxGui::GLGuiInputLine* shineSizeText = new OrxGui::GLGuiInputLine();
     412        OrxGui::GLGuiText* shineSizeText = new OrxGui::GLGuiText();
    413413        shineSizeText->setText("ShineSize");
    414414        shineSizeBox->pack(shineSizeText);
     
    425425      OrxGui::GLGuiBox* shineStrengthBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    426426      {
    427         OrxGui::GLGuiInputLine* shineStrengthText = new OrxGui::GLGuiInputLine();
     427        OrxGui::GLGuiText* shineStrengthText = new OrxGui::GLGuiText();
    428428        shineStrengthText->setText("ShineStrength");
    429429        shineStrengthBox->pack(shineStrengthText);
     
    440440      OrxGui::GLGuiBox* reflStrengthBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    441441      {
    442         OrxGui::GLGuiInputLine* reflStrengthText = new OrxGui::GLGuiInputLine();
     442        OrxGui::GLGuiText* reflStrengthText = new OrxGui::GLGuiText();
    443443        reflStrengthText->setText("ReflStrength");
    444444        reflStrengthBox->pack(reflStrengthText);
     
    455455      OrxGui::GLGuiBox* refractionBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    456456      {
    457         OrxGui::GLGuiInputLine* refractionText = new OrxGui::GLGuiInputLine();
     457        OrxGui::GLGuiText* refractionText = new OrxGui::GLGuiText();
    458458        refractionText->setText("Refraction");
    459459        refractionBox->pack(refractionText);
     
    470470      OrxGui::GLGuiBox* lightPosBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    471471      {
    472         OrxGui::GLGuiInputLine* lightPosText = new OrxGui::GLGuiInputLine();
     472        OrxGui::GLGuiText* lightPosText = new OrxGui::GLGuiText();
    473473        lightPosText->setText("LightPos");
    474474        lightPosBox->pack(lightPosText);
     
    499499      OrxGui::GLGuiBox* waterHeightBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    500500      {
    501         OrxGui::GLGuiInputLine* waterHeightText = new OrxGui::GLGuiInputLine();
     501        OrxGui::GLGuiText* waterHeightText = new OrxGui::GLGuiText();
    502502        waterHeightText->setText("WaterHeight");
    503503        waterHeightBox->pack(waterHeightText);
  • trunk/src/world_entities/player.cc

    r8362 r9019  
    3838
    3939  this->playable = NULL;
    40   this->hud.setVisibility(true);
     40  this->_hud.setVisibility(true);
    4141
    4242  this->subscribeEvent(ES_GAME, KeyMapper::PEV_CHANGE_SHIP);
     
    6262  {
    6363    PRINTF(4)("Player gets ejected from Playable\n");
    64     this->hud.setEnergyWidget(NULL);
    65     this->hud.setWeaponManager(NULL);
     64    this->_hud.setEnergyWidget(NULL);
     65    this->_hud.setWeaponManager(NULL);
    6666
    6767    Playable* ejectedPlayable = this->playable;
     
    7575    PRINTF(4)("Enter new Playable\n");
    7676      this->playable = playable;
    77       this->hud.setEnergyWidget(this->playable->getHealthWidget());
    78       this->hud.setWeaponManager(&this->playable->getWeaponManager());
     77      this->_hud.setEnergyWidget(this->playable->getHealthWidget());
     78      this->_hud.setWeaponManager(&this->playable->getWeaponManager());
    7979
    8080      this->playable->setPlayer(this);
     
    9696 void Player::weaponConfigChanged()
    9797 {
    98    this->hud.updateWeaponManager();
     98   this->_hud.updateWeaponManager();
    9999 }
    100100
  • trunk/src/world_entities/player.h

    r9002 r9019  
    3232    inline Playable*  getPlayable() const  { return this->playable; };
    3333
    34 //     inline Hud& hud() { return this->_hud; };
    35 //     inline const Hud& hud() const { return this->_hud; };
     34     inline Hud& hud() { return this->_hud; };
     35     inline const Hud& hud() const { return this->_hud; };
    3636
    3737
     
    4343  private:
    4444    Playable*         playable;                 //!< The one we controll or NULL if none
    45     Hud               hud;                      //!< The HUD to be displayed for this Player.
     45    Hud               _hud;                      //!< The HUD to be displayed for this Player.
    4646};
    4747
Note: See TracChangeset for help on using the changeset viewer.