Changeset 191


Ignore:
Timestamp:
12/25/06 03:15:19 (17 years ago)
Author:
r2d
Message:
  • Added UI
  • Display tag & stream info (can't edit)
Location:
winamp-musepack/trunk/winamp-musepack
Files:
3 added
4 edited

Legend:

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

    r190 r191  
    185185int infoDlg(char *fn, HWND hwnd)
    186186{
    187         // CHANGEME! Write your own info dialog code here
    188         return 0;
     187        mpc_player info_play(fn, &mod);
     188        return info_play.infoDlg(hwnd);
    189189}
    190190
  • 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}
  • winamp-musepack/trunk/winamp-musepack/mpc_player.h

    r190 r191  
    4343        void setOutputTime(int time_in_ms);
    4444
     45        int infoDlg(HWND hwnd);
     46
    4547        int paused;                             // are we paused?
    4648
  • winamp-musepack/trunk/winamp-musepack/winamp-musepack.vcproj

    r189 r191  
    55        Name="winamp-musepack"
    66        ProjectGUID="{EEA7D671-FB86-4E8D-8F1A-CC05174342F0}"
     7        RootNamespace="winamp-musepack"
    78        >
    89        <Platforms>
     
    4041                                AdditionalIncludeDirectories="..\..\libmpc\include;C:\Program Files\taglib\include\taglib"
    4142                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
     43                                RuntimeLibrary="2"
     44                                WarningLevel="3"
    4245                                DebugInformationFormat="1"
    4346                        />
     
    5659                                OutputFile="E:\Program Files\Winamp\Plugins\in_mpc.dll"
    5760                                AdditionalLibraryDirectories="..\..\libmpc\win32\Debug;C:\Program Files\taglib\lib"
     61                                GenerateManifest="false"
    5862                                IgnoreAllDefaultLibraries="false"
    59                                 IgnoreDefaultLibraryNames="LIBCMTD;MSVCRT"
     63                                IgnoreDefaultLibraryNames="LIBCMTD;MSVCRT;MSVCMRT"
    6064                                GenerateDebugInformation="true"
    6165                        />
     
    8791                <Configuration
    8892                        Name="Release|Win32"
     93                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"
    8994                        IntermediateDirectory="$(ConfigurationName)"
    90                         ConfigurationType="1"
     95                        ConfigurationType="2"
    9196                        >
    9297                        <Tool
     
    107112                        <Tool
    108113                                Name="VCCLCompilerTool"
     114                                AdditionalIncludeDirectories="..\..\libmpc\include;C:\Program Files\taglib\include\taglib"
     115                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
     116                                RuntimeLibrary="2"
     117                                WarningLevel="1"
    109118                        />
    110119                        <Tool
     
    119128                        <Tool
    120129                                Name="VCLinkerTool"
     130                                AdditionalDependencies="User32.lib libmpcdec.lib libcommon.lib tag.lib"
     131                                OutputFile="E:\Program Files\Winamp\Plugins\in_mpc.dll"
     132                                AdditionalLibraryDirectories="..\..\libmpc\win32\Release;C:\Program Files\taglib\lib"
     133                                GenerateManifest="true"
     134                                IgnoreDefaultLibraryNames="LIBCMT"
    121135                        />
    122136                        <Tool
     
    147161        </Configurations>
    148162        <References>
     163                <AssemblyReference
     164                        RelativePath="System.dll"
     165                        AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
     166                />
     167                <AssemblyReference
     168                        RelativePath="System.Data.dll"
     169                        AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
     170                />
     171                <AssemblyReference
     172                        RelativePath="System.Drawing.dll"
     173                        AssemblyName="System.Drawing, Version=2.0.0.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
     174                />
     175                <AssemblyReference
     176                        RelativePath="System.Windows.Forms.dll"
     177                        AssemblyName="System.Windows.Forms, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
     178                />
     179                <AssemblyReference
     180                        RelativePath="System.XML.dll"
     181                        AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
     182                />
    149183        </References>
    150184        <Files>
     
    159193                        </File>
    160194                        <File
     195                                RelativePath=".\mpc_info.cpp"
     196                                >
     197                                <FileConfiguration
     198                                        Name="Debug|Win32"
     199                                        >
     200                                        <Tool
     201                                                Name="VCCLCompilerTool"
     202                                                MinimalRebuild="false"
     203                                                ExceptionHandling="2"
     204                                                BasicRuntimeChecks="0"
     205                                                UsePrecompiledHeader="0"
     206                                                DebugInformationFormat="3"
     207                                                CompileAsManaged="1"
     208                                        />
     209                                </FileConfiguration>
     210                                <FileConfiguration
     211                                        Name="Release|Win32"
     212                                        >
     213                                        <Tool
     214                                                Name="VCCLCompilerTool"
     215                                                MinimalRebuild="false"
     216                                                ExceptionHandling="2"
     217                                                BasicRuntimeChecks="0"
     218                                                UsePrecompiledHeader="0"
     219                                                DebugInformationFormat="3"
     220                                                CompileAsManaged="1"
     221                                        />
     222                                </FileConfiguration>
     223                        </File>
     224                        <File
    161225                                RelativePath=".\mpc_player.cpp"
    162226                                >
     227                                <FileConfiguration
     228                                        Name="Debug|Win32"
     229                                        >
     230                                        <Tool
     231                                                Name="VCCLCompilerTool"
     232                                                ExceptionHandling="2"
     233                                                CompileAsManaged="1"
     234                                        />
     235                                </FileConfiguration>
     236                                <FileConfiguration
     237                                        Name="Release|Win32"
     238                                        >
     239                                        <Tool
     240                                                Name="VCCLCompilerTool"
     241                                                ExceptionHandling="2"
     242                                                CompileAsManaged="1"
     243                                        />
     244                                </FileConfiguration>
    163245                        </File>
    164246                </Filter>
     
    173255                        </File>
    174256                        <File
     257                                RelativePath=".\mpc_info.h"
     258                                FileType="3"
     259                                >
     260                                <File
     261                                        RelativePath=".\mpc_info.resx"
     262                                        SubType="Designer"
     263                                        >
     264                                </File>
     265                        </File>
     266                        <File
    175267                                RelativePath=".\mpc_player.h"
    176268                                >
Note: See TracChangeset for help on using the changeset viewer.