Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Commit

Permalink
drivercfg: added compression info column
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Miller committed Aug 1, 2012
1 parent 94ba057 commit 838f03f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3.1:
driver/config
* added support for sf2pack files(soundfonts with lossy/lossless compressed samples)
3.01:
driver/config
* added sinc interpolation
Expand Down
80 changes: 67 additions & 13 deletions drivercfg/Views.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#define LOADBASSMIDIFUNCTION(f) *((void**)&f)=GetProcAddress(bassmidi,#f)
#include "../bass.h"
#include "../bassmidi.h"
#include "../bassopus.h"
#include "../bassflac.h"
#include "../basswv.h"

using namespace std;
using namespace utf8util;
Expand Down Expand Up @@ -85,7 +88,7 @@ class CView1 : public CDialogImpl<CView1>


listbox.AddColumn(L"SoundFont Name",0);
listbox.AddColumn(L"Packed",1);
listbox.AddColumn(L"Compression",1);
listbox.AddColumn(L"SoundFont Filename",2);


Expand Down Expand Up @@ -123,6 +126,35 @@ class CView1 : public CDialogImpl<CView1>
BASS_MIDI_FontGetInfo(sf2,&info);
wstring utf8 = utf16_from_utf8(info.name);
listbox.AddItem(0,0,utf8.c_str());
switch (info.samtype)
{
case -1:
listbox.AddItem(0,1,L"Unknown");
case 0:
listbox.AddItem(0,1,L"None");
break;
case BASS_CTYPE_STREAM_OGG:
listbox.AddItem(0,1,L"Vorbis");
break;
case BASS_CTYPE_STREAM_MP1:
listbox.AddItem(0,1,L"MP1");
break;
case BASS_CTYPE_STREAM_MP2:
listbox.AddItem(0,1,L"MP2");
break;
case BASS_CTYPE_STREAM_MP3:
listbox.AddItem(0,1,L"MP3");
break;
case BASS_CTYPE_STREAM_FLAC:
listbox.AddItem(0,1,L"FLAC");
break;
case BASS_CTYPE_STREAM_WV:
listbox.AddItem(0,1,L"WavPack");
break;
case BASS_CTYPE_STREAM_OPUS:
listbox.AddItem(0,1,L"Opus");
break;
}
listbox.AddItem(0,2,szFileName);
BASS_MIDI_FontFree(sf2);
}
Expand All @@ -146,18 +178,15 @@ class CView1 : public CDialogImpl<CView1>

LRESULT OnButtonDown( WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/ )
{
TCHAR SelectedItemFileName[MAX_PATH];
TCHAR SelectedItemName[MAX_PATH];
TCHAR items[3][MAX_PATH];
int amount_items = listbox.GetItemCount();
amount_items--;
int selectedindex = listbox.GetSelectionMark();
if (selectedindex != amount_items && selectedindex != -1)
{
listbox.GetItemText(selectedindex,2,SelectedItemFileName,sizeof(SelectedItemFileName));
listbox.GetItemText(selectedindex,0,SelectedItemName,sizeof(SelectedItemName));
for (int i=0;i<3;i++)listbox.GetItemText(selectedindex,i,items[i],MAX_PATH);
listbox.DeleteItem(selectedindex);
listbox.AddItem(selectedindex+1,0,SelectedItemName);
listbox.AddItem(selectedindex+1,2,SelectedItemFileName);
for (int i=0;i<3;i++) listbox.AddItem(selectedindex+1,i,items[i],MAX_PATH);
listbox.SetSelectionMark(selectedindex+1);
}
return 0;
Expand All @@ -167,16 +196,13 @@ class CView1 : public CDialogImpl<CView1>
LRESULT OnButtonUp( WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/ )
{
int amount_items = listbox.GetItemCount();
TCHAR SelectedItemFileName[MAX_PATH];
TCHAR SelectedItemName[MAX_PATH];
TCHAR items[3][MAX_PATH];
int selectedindex = listbox.GetSelectionMark();
if (selectedindex != 0)
{
listbox.GetItemText(selectedindex,0,SelectedItemName,sizeof(SelectedItemName));
listbox.GetItemText(selectedindex,2,SelectedItemFileName,sizeof(SelectedItemFileName));
for (int i=0;i<3;i++)listbox.GetItemText(selectedindex,i,items[i],MAX_PATH);
listbox.DeleteItem(selectedindex);
listbox.AddItem(selectedindex-1,0,SelectedItemName);
listbox.AddItem(selectedindex-1,2,SelectedItemFileName);
for (int i=0;i<3;i++) listbox.AddItem(selectedindex-1,i,items[i],MAX_PATH);
listbox.SetSelectionMark(selectedindex-1);
}
return 0;
Expand All @@ -192,6 +218,7 @@ class CView1 : public CDialogImpl<CView1>

void read_sflist(TCHAR * sfpath)
{
char* ctypes = "None";
int font_count;
listbox.DeleteAllItems();
if (sfpath && *sfpath)
Expand Down Expand Up @@ -230,6 +257,33 @@ class CView1 : public CDialogImpl<CView1>
BASS_MIDI_FontGetInfo(sf2,&info);
wstring utf8 = utf16_from_utf8(info.name);
listbox.AddItem(0,0,utf8.c_str());

switch (info.samtype)
{
case -1:
listbox.AddItem(0,1,L"Unknown");
case 0:
listbox.AddItem(0,1,L"None");
break;
case BASS_CTYPE_STREAM_OGG:
listbox.AddItem(0,1,L"Vorbis");
break;
case BASS_CTYPE_STREAM_MP1:
listbox.AddItem(0,1,L"MP1");
break;
case BASS_CTYPE_STREAM_MP2:
listbox.AddItem(0,1,L"MP2");
break;
case BASS_CTYPE_STREAM_MP3:
listbox.AddItem(0,1,L"MP3");
break;
case BASS_CTYPE_STREAM_FLAC:
listbox.AddItem(0,1,L"FLAC");
break;
case BASS_CTYPE_STREAM_WV:
listbox.AddItem(0,1,L"WavPack");
break;
}
listbox.AddItem(0,2,cr);
BASS_MIDI_FontFree(sf2);
}
Expand Down
5 changes: 5 additions & 0 deletions drivercfg/drivercfg.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\bass.h" />
<ClInclude Include="..\bassflac.h" />
<ClInclude Include="..\bassmidi.h" />
<ClInclude Include="..\bassopus.h" />
<ClInclude Include="..\basswv.h" />
<ClInclude Include="AboutDlg.h" />
<ClInclude Include="DlgTabCtrl.h" />
<ClInclude Include="MainDlg.h" />
Expand Down

0 comments on commit 838f03f

Please sign in to comment.