Ignore:
Timestamp:
12/25/06 03:15:19 (17 years ago)
Author:
r2d
Message:
  • Added UI
  • Display tag & stream info (can't edit)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • winamp-musepack/trunk/winamp-musepack/mpc_player.cpp

    r190 r191  
    1919
    2020#include <windows.h>
     21#include <math.h>
    2122
    2223#include "in2.h"
    2324#include "mpc_player.h"
    2425#include <mpc/minimax.h>
     26#include "mpc_info.h"
    2527
    2628#include <tag.h>
     29
     30using namespace winamp_musepack;
    2731
    2832mpc_player::mpc_player(In_Module * in_mod)
     
    209213                if (wait_event) SetEvent(wait_event);
    210214                if (WaitForSingleObject(thread_handle,10000) == WAIT_TIMEOUT) {
    211                         MessageBox(mod->hMainWindow,"error asking thread to die!\n",
     215                        MessageBoxA(mod->hMainWindow,"error asking thread to die!\n",
    212216                                "error killing decode thread", 0);
    213217                        TerminateThread(thread_handle, 0);
     
    266270        return 0;
    267271}
     272
     273int mpc_player::infoDlg(HWND hwnd)
     274{
     275        mpc_info infoBox;
     276        System::String ^ tmp;
     277
     278        tmp = "Streamversion ";
     279        tmp += si.stream_version;
     280        tmp += "\nEncoder : ";
     281        tmp += gcnew String(si.encoder);
     282        tmp += "\nProfile : ";
     283        tmp += gcnew String(si.profile_name);
     284        tmp += "\nPNS : ";
     285        tmp += si.pns ? "on" : "off";
     286        tmp += "\nGapless : ";
     287        tmp += si.is_true_gapless ? "on" : "off";
     288        tmp += "\nAverage bitrate : ";
     289        tmp += floor(si.average_bitrate * 1.e-3 + .5);
     290        tmp += " Kbps \nSamplerate : ";
     291        tmp += si.sample_freq;
     292        tmp += "\nChannels : ";
     293        tmp += si.channels;
     294        tmp += "\nFile size : ";
     295        tmp += si.total_file_length;
     296        tmp += " Bytes";
     297        // FIXME : add replay gain info
     298
     299        infoBox.lblStreamInfo->Text = tmp;
     300
     301
     302        if(tag_file == 0)
     303                tag_file = new TagLib::FileRef(lastfn, false);
     304
     305        if (!tag_file->isNull() && tag_file->tag()) {
     306                TagLib::Tag *tag = tag_file->tag();
     307                infoBox.txtTitle->Text = gcnew String(tag->title().toCString(true));
     308                infoBox.txtArtist->Text = gcnew String(tag->artist().toCString(true));
     309                infoBox.txtAlbum->Text = gcnew String(tag->album().toCString(true));
     310                infoBox.txtYear->Text += tag->year();
     311                infoBox.txtTrack->Text += tag->track();
     312                infoBox.comboGenre->Text = gcnew String(tag->genre().toCString(true));
     313                infoBox.txtComment->Text = gcnew String(tag->comment().toCString(true));
     314        }
     315
     316        infoBox.ShowDialog();
     317        return 0;
     318}
Note: See TracChangeset for help on using the changeset viewer.