Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be95db47c0 | ||
|
|
31fab8ccf1 | ||
|
|
200fb5c4e1 | ||
|
|
2d30c7a3bf | ||
|
|
d65b1fa3ec | ||
|
|
e4b43dbf46 | ||
|
|
ce81094a62 | ||
|
|
04b51ee5ea | ||
|
|
40b962250f | ||
|
|
d633806464 | ||
|
|
bbe91b949b | ||
|
|
981b995308 | ||
|
|
40119b2e4e | ||
|
|
caaec15f31 | ||
|
|
873c785df9 | ||
|
|
d372671f1b | ||
|
|
f80714542d | ||
|
|
d1fd4a6eea | ||
|
|
a20fad4635 | ||
|
|
aefd8e6434 | ||
|
|
7da19e19e0 | ||
|
|
d5b22fc6b2 | ||
|
|
0f39765877 | ||
|
|
6a327c46f3 | ||
|
|
d8649831f8 | ||
|
|
4539a489a4 | ||
|
|
b66955d5b4 | ||
|
|
af56fe3338 | ||
|
|
d536b187ec | ||
|
|
699935c9f8 | ||
|
|
e463cdab73 | ||
|
|
5b6da80ec2 | ||
|
|
f44f57150b | ||
|
|
1a3b31ec9e | ||
|
|
a7daecd589 | ||
|
|
fe27bb453c | ||
|
|
7708e43b3d | ||
|
|
bf1d86772a | ||
|
|
7088df85e1 | ||
|
|
a8622f8ea4 | ||
|
|
1d4699a29b | ||
|
|
87c147685b | ||
|
|
b32774b6f1 | ||
|
|
cb02cddfb5 | ||
|
|
936e512859 | ||
|
|
1e765e6306 | ||
|
|
bd651ef400 | ||
|
|
ea8240768c | ||
|
|
f8a1a4aff4 | ||
|
|
031c647784 | ||
|
|
49d6fa5aa9 | ||
|
|
13588da443 | ||
|
|
948f78da10 | ||
|
|
d4a7979c11 | ||
|
|
7b2f4cb455 | ||
|
|
26bf66f985 | ||
|
|
97f1988a11 | ||
|
|
e4a5088ce2 | ||
|
|
58c761e4fa | ||
|
|
3b66ff4424 | ||
|
|
e57362eec8 | ||
|
|
101a44e26f | ||
|
|
4c45818bf8 | ||
|
|
b66f645a25 | ||
|
|
f0d2bae6c2 | ||
|
|
8aed9d2c78 | ||
|
|
33002f81d8 | ||
|
|
e7ef2d7eaf | ||
|
|
447dbfb743 | ||
|
|
17f81ddd2f | ||
|
|
b12dad72bc | ||
|
|
bce29362f4 | ||
|
|
fe980611c4 |
No files matched your search
@@ -6,7 +6,7 @@
|
||||
name="CompanyName.ProductName.YourApplication"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Easy Audio Player - A school project that helps me learn C++</description>
|
||||
<description>ClickPlay</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
@@ -24,20 +24,14 @@
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Pliki nagłówkowe</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="EzWinAPIBuilders.h">
|
||||
<Filter>Pliki nagłówkowe</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Pliki źródłowe</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="EzWinAPIBuilders.cpp">
|
||||
<Filter>Pliki źródłowe</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Easy Audio Player.rc">
|
||||
<ResourceCompile Include="ClickPlay.rc">
|
||||
<Filter>Pliki zasobów</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
@@ -45,12 +39,12 @@
|
||||
<Image Include="small.ico">
|
||||
<Filter>Pliki zasobów</Filter>
|
||||
</Image>
|
||||
<Image Include="Easy Audio Player.ico">
|
||||
<Image Include="ClickPlay.ico">
|
||||
<Filter>Pliki zasobów</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Manifest Include="EasyAudioPlayer.exe.manifest">
|
||||
<Manifest Include="ClickPlay.exe.manifest">
|
||||
<Filter>Pliki źródłowe</Filter>
|
||||
</Manifest>
|
||||
</ItemGroup>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -3,24 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31129.286
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy Audio Player", "Easy Audio Player.vcxproj", "{C734FDA7-262E-4202-8F4E-5E3031CB9935}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClickPlay", "ClickPlay.vcxproj", "{C734FDA7-262E-4202-8F4E-5E3031CB9935}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Debug|x64.Build.0 = Debug|x64
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Debug|x86.Build.0 = Debug|Win32
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Release|x64.ActiveCfg = Release|x64
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Release|x64.Build.0 = Release|x64
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Release|x86.ActiveCfg = Release|Win32
|
||||
{C734FDA7-262E-4202-8F4E-5E3031CB9935}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -22,8 +22,9 @@
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{c734fda7-262e-4202-8f4e-5e3031cb9935}</ProjectGuid>
|
||||
<RootNamespace>EasyAudioPlayer</RootNamespace>
|
||||
<RootNamespace>ClickPlay</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>ClickPlay</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
@@ -143,24 +144,22 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="EzWinAPIBuilders.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="EzWinAPIBuilders.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Easy Audio Player.rc" />
|
||||
<ResourceCompile Include="ClickPlay.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Easy Audio Player.ico" />
|
||||
<Image Include="ClickPlay.ico" />
|
||||
<Image Include="small.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Manifest Include="EasyAudioPlayer.exe.manifest" />
|
||||
<Manifest Include="ClickPlay.exe.manifest" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
@@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
|
Before Width: | Height: | Size: 86 KiB |
@@ -1,40 +0,0 @@
|
||||
#include "EzWinAPIBuilders.h"
|
||||
|
||||
WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance, LPCWSTR classIcon, LPCWSTR cursor) {
|
||||
WNDCLASSEX wc;
|
||||
wc.style = 0;
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
wc.lpfnWndProc = messageLoop;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = instance;
|
||||
wc.hIcon = LoadIcon(NULL, classIcon);
|
||||
wc.hCursor = LoadCursor(NULL, cursor);
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = name;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hIconSm = LoadIcon(NULL, IDI_ERROR);
|
||||
return wc;
|
||||
}
|
||||
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent, HMENU menu) {
|
||||
return CreateWindowEx(WS_EX_CLIENTEDGE, windowClass.lpszClassName, windowTitle, windowStyles, CW_USEDEFAULT, CW_USEDEFAULT, windowWidth, windowHeight, parent, menu, instance, NULL);
|
||||
}
|
||||
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles) {
|
||||
if (styles == NULL) {
|
||||
styles = WS_CHILD | WS_VISIBLE;
|
||||
}
|
||||
return CreateWindowEx(0, L"BUTTON", label, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
|
||||
}
|
||||
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles) {
|
||||
if (styles == NULL) {
|
||||
styles = WS_CHILD | WS_VISIBLE;
|
||||
}
|
||||
return CreateWindowEx(0, L"STATIC", startingContent, styles, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
|
||||
}
|
||||
HWND EzCreateControl(LPCWSTR type, LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles) {
|
||||
if (styles == NULL) {
|
||||
styles = WS_CHILD | WS_VISIBLE;
|
||||
}
|
||||
return CreateWindowEx(0, type, startingContent, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#ifndef FUNCTIONS_H_INCLUDED
|
||||
#define FUNCTIONS_H_INCLUDED
|
||||
WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance, LPCWSTR classIcon, LPCWSTR cursor);
|
||||
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent, HMENU menu);
|
||||
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles);
|
||||
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles);
|
||||
HWND EzCreateControl(LPCWSTR type, LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles);
|
||||
#endif
|
||||
@@ -1,30 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Easy Audio Player.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDD_EASYAUDIOPLAYER_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_EASYAUDIOPLAYER 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_EASYAUDIOPLAYER 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_MENU 200
|
||||
#define ID_PLIK_OD32774 32774
|
||||
#define ID_REFRESH 32775
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32776
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="511.55136" height="744.68427" viewBox="0 0 135.34796 197.03105" version="1.1" id="svg8" inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" sodipodi:docname="logo.svg">
|
||||
<defs id="defs2">
|
||||
<linearGradient inkscape:collect="always" id="linearGradient839">
|
||||
<stop style="stop-color:#0078ff;stop-opacity:1;" offset="0" id="stop835" />
|
||||
<stop style="stop-color:#0000ff;stop-opacity:1" offset="1" id="stop837" />
|
||||
</linearGradient>
|
||||
<linearGradient inkscape:collect="always" xlink:href="#linearGradient839" id="linearGradient865" x1="190.23459" y1="132.03839" x2="66.307961" y2="131.49152" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1.0867393,0,0,0.96763643,271.58074,6.2930973)" />
|
||||
</defs>
|
||||
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.98994949" inkscape:cx="155.77567" inkscape:cy="395.40231" inkscape:document-units="mm" inkscape:current-layer="layer2" inkscape:document-rotation="0" showgrid="false" units="px" inkscape:window-width="2560" inkscape:window-height="1377" inkscape:window-x="1912" inkscape:window-y="-8" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" />
|
||||
<metadata id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g inkscape:groupmode="layer" id="layer2" inkscape:label="File" sodipodi:insensitive="true" transform="translate(-64.617685,-33.776144)">
|
||||
<path style="fill:url(#linearGradient865);fill-opacity:1;stroke:#0164ff;stroke-width:1.3566;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 199.1224,58.228678 175.05177,34.601646 65.37845,34.455349 65.29627,230.12815 199.2867,229.98183 Z" id="path857" sodipodi:nodetypes="cccccc" sodipodi:insensitive="true" />
|
||||
<path d="m 142.2675,84.893749 -34.82668,5.709865 -0.0335,36.563036 c -0.0116,20.11101 -0.0446,36.56301 -0.078,36.56301 -0.0335,0 -0.32319,-0.18069 -0.65753,-0.39752 -1.57138,-1.02994 -4.25719,-1.59008 -7.678557,-1.59008 -4.390948,0 -8.982496,1.66235 -13.373446,4.82448 -3.421371,2.46644 -5.750572,5.47495 -6.619849,8.55575 -0.289757,1.02092 -0.256328,3.32473 0.05571,4.26433 1.014145,3.01757 3.93401,5.18586 7.87918,5.85442 1.159031,0.19877 3.432518,0.2349 4.73643,0.0813 5.917748,-0.72278 11.902352,-3.83067 15.323722,-7.99561 1.27047,-1.5359 2.15089,-3.17116 2.69696,-5.01421 0.18946,-0.64145 0.20061,-2.4032 0.22289,-36.90633 l 0.0335,-36.237798 32.46403,-5.303313 c 17.84242,-2.927188 32.48634,-5.312331 32.54207,-5.303298 0.0446,0 0.078,14.437279 0.078,32.081869 v 32.07287 l -0.46806,-0.30717 c -1.80542,-1.18354 -4.14579,-1.70754 -7.77889,-1.71657 -1.60481,0 -2.13976,0.027 -3.04247,0.18972 -5.40509,0.9667 -11.12224,4.25529 -14.51018,8.33895 -0.79126,0.94861 -1.72741,2.50256 -2.16204,3.55961 -0.95843,2.35803 -0.88042,4.93289 0.20059,6.86631 1.32621,2.36706 4.35752,4.14686 7.84576,4.60764 4.46896,0.58723 10.64303,-1.05704 14.96712,-3.97523 3.81144,-2.57486 6.09607,-5.38462 7.1548,-8.80874 l 0.30089,-0.94862 0.0224,-40.6828 0.0336,-40.673772 -0.24519,0.0091 c -0.14487,0 -15.92556,2.574856 -35.083,5.718901 z" id="path845" style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.46031;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" sodipodi:insensitive="true" />
|
||||
<path style="fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 175.05177,35.130811 -0.39114,23.26758 23.9326,-0.169715" id="path870" sodipodi:nodetypes="ccc" sodipodi:insensitive="true" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="1000" height="1000" viewBox="0 0 264.58333 264.58334" version="1.1" id="svg8" inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" sodipodi:docname="logobg.svg">
|
||||
<defs id="defs2">
|
||||
<linearGradient inkscape:collect="always" id="linearGradient839">
|
||||
<stop style="stop-color:#0078ff;stop-opacity:1;" offset="0" id="stop835" />
|
||||
<stop style="stop-color:#0000ff;stop-opacity:1" offset="1" id="stop837" />
|
||||
</linearGradient>
|
||||
<linearGradient inkscape:collect="always" xlink:href="#linearGradient839" id="linearGradient841" x1="1.9073486e-06" y1="132.29166" x2="264.58333" y2="132.29166" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.97786001,0,0,0.97786007,2.9289412,2.9289413)" />
|
||||
<linearGradient inkscape:collect="always" xlink:href="#linearGradient839" id="linearGradient865" x1="190.23459" y1="132.03839" x2="66.307961" y2="131.49152" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1.0867393,0,0,0.96763643,271.58074,6.2930973)" />
|
||||
</defs>
|
||||
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.98994949" inkscape:cx="400" inkscape:cy="523.06019" inkscape:document-units="mm" inkscape:current-layer="layer1" inkscape:document-rotation="0" showgrid="false" units="px" inkscape:window-width="2560" inkscape:window-height="1377" inkscape:window-x="1912" inkscape:window-y="-8" inkscape:window-maximized="1" />
|
||||
<metadata id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g inkscape:label="Bg" inkscape:groupmode="layer" id="layer1" sodipodi:insensitive="true">
|
||||
<rect style="fill:#000000;fill-opacity:1;stroke:url(#linearGradient841);stroke-width:7.81934;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none" id="rect833" width="256.76398" height="256.76398" x="3.9096732" y="3.9096732" sodipodi:insensitive="true" />
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="layer2" inkscape:label="File" sodipodi:insensitive="true">
|
||||
<path style="fill:url(#linearGradient865);fill-opacity:1;stroke:#0164ff;stroke-width:1.3566;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 199.1224,58.228678 175.05177,34.601646 65.37845,34.455349 65.29627,230.12815 199.2867,229.98183 Z" id="path857" sodipodi:nodetypes="cccccc" sodipodi:insensitive="true" />
|
||||
<path d="m 142.2675,84.893749 -34.82668,5.709865 -0.0335,36.563036 c -0.0116,20.11101 -0.0446,36.56301 -0.078,36.56301 -0.0335,0 -0.32319,-0.18069 -0.65753,-0.39752 -1.57138,-1.02994 -4.25719,-1.59008 -7.678557,-1.59008 -4.390948,0 -8.982496,1.66235 -13.373446,4.82448 -3.421371,2.46644 -5.750572,5.47495 -6.619849,8.55575 -0.289757,1.02092 -0.256328,3.32473 0.05571,4.26433 1.014145,3.01757 3.93401,5.18586 7.87918,5.85442 1.159031,0.19877 3.432518,0.2349 4.73643,0.0813 5.917748,-0.72278 11.902352,-3.83067 15.323722,-7.99561 1.27047,-1.5359 2.15089,-3.17116 2.69696,-5.01421 0.18946,-0.64145 0.20061,-2.4032 0.22289,-36.90633 l 0.0335,-36.237798 32.46403,-5.303313 c 17.84242,-2.927188 32.48634,-5.312331 32.54207,-5.303298 0.0446,0 0.078,14.437279 0.078,32.081869 v 32.07287 l -0.46806,-0.30717 c -1.80542,-1.18354 -4.14579,-1.70754 -7.77889,-1.71657 -1.60481,0 -2.13976,0.027 -3.04247,0.18972 -5.40509,0.9667 -11.12224,4.25529 -14.51018,8.33895 -0.79126,0.94861 -1.72741,2.50256 -2.16204,3.55961 -0.95843,2.35803 -0.88042,4.93289 0.20059,6.86631 1.32621,2.36706 4.35752,4.14686 7.84576,4.60764 4.46896,0.58723 10.64303,-1.05704 14.96712,-3.97523 3.81144,-2.57486 6.09607,-5.38462 7.1548,-8.80874 l 0.30089,-0.94862 0.0224,-40.6828 0.0336,-40.673772 -0.24519,0.0091 c -0.14487,0 -15.92556,2.574856 -35.083,5.718901 z" id="path845" style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.46031;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" sodipodi:insensitive="true" />
|
||||
<path style="fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 175.05177,35.130811 -0.39114,23.26758 23.9326,-0.169715" id="path870" sodipodi:nodetypes="ccc" sodipodi:insensitive="true" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
@@ -1,14 +1,7 @@
|
||||
// header.h: plik dołączany dla standardowych systemowych plików dołączanych,
|
||||
// lub pliki dołączane specyficzne dla projektu
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Wyklucz rzadko używane rzeczy z nagłówków systemu Windows
|
||||
// Pliki nagłówkowe systemu Windows
|
||||
#include <windows.h>
|
||||
// Pliki nagłówkowe środowiska uruchomieniowego języka C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
|
||||
@@ -1,24 +1,39 @@
|
||||
//INCLUDES
|
||||
#include "EzWinAPIBuilders.h"
|
||||
#include "framework.h"
|
||||
#include "resource.h"
|
||||
#include <ShlObj.h>
|
||||
#include <debugapi.h>
|
||||
#include <strsafe.h>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <cwctype>
|
||||
#include <cstdlib>
|
||||
#include <time.h>
|
||||
|
||||
//USING IMPORTS
|
||||
using std::wstringstream;
|
||||
//IMPORTS
|
||||
using std::wstring;
|
||||
using std::vector;
|
||||
|
||||
//CONTROL IDS
|
||||
#define IDC_DIRLABEL 201
|
||||
#define IDC_BROWSEBTN 202
|
||||
#define IDC_LIST 203
|
||||
#define IDC_SEARCH 204
|
||||
#define IDC_SEARCHBTN 205
|
||||
#define IDC_NPLABEL 206
|
||||
#define IDC_PLAYBTN 207
|
||||
#define IDC_STOPBTN 208
|
||||
|
||||
//STATIC DEFINES
|
||||
#define IDC_LIST 1
|
||||
#define NOT_PLAYING_LABEL L"Nic nie jest odtwarzane"
|
||||
#define PLAY_LABEL L"Odtwarzaj"
|
||||
#define PAUSE_LABEL L"Pauza"
|
||||
#define EXT_LENGTH 2
|
||||
#define STATE_CHANGE 333
|
||||
|
||||
//STRING TABLE
|
||||
#define PROGRAM_NAME L"ClickPlay"
|
||||
#define NOT_PLAYING_LABEL L"-"
|
||||
#define PLAY_LABEL L"Odtwarzaj"
|
||||
#define PAUSE_LABEL L"Pauza"
|
||||
#define NO_DIR_LOADED_LABEL L"Brak katalogu"
|
||||
|
||||
//GLOBAL VARS
|
||||
HFONT hFont = CreateFont(18, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Segoe UI"));
|
||||
HINSTANCE globalInstance;
|
||||
@@ -26,146 +41,310 @@ MSG msg;
|
||||
wstring ext[EXT_LENGTH] = { L"mp3", L"wav" };
|
||||
|
||||
//PATH VARS
|
||||
TCHAR path[MAX_PATH] = { NULL };
|
||||
TCHAR* selected = NULL;
|
||||
vector<WIN32_FIND_DATA> files;
|
||||
wstring path;
|
||||
wstring currentSearchPhrase;
|
||||
__int64 selected = -1;
|
||||
|
||||
//STATE VARS
|
||||
/*
|
||||
* -1 - not loaded
|
||||
* 0 - nothing is playing
|
||||
* -1 - not ready
|
||||
* 0 - ready
|
||||
* 1 - playback active
|
||||
* 2 - playback paused
|
||||
*/
|
||||
int currentState = -1;
|
||||
BOOL isOnClickPlayEnabled = TRUE;
|
||||
BOOL isAutoPlayEnabled = TRUE;
|
||||
BOOL isLoopEnabled = FALSE;
|
||||
BOOL isQueued = FALSE;
|
||||
BOOL showExtensions = FALSE;
|
||||
|
||||
//CONTROLS
|
||||
HWND mainWindow;
|
||||
HWND dirLabel;
|
||||
HWND browseButton;
|
||||
HWND filesListCtrl;
|
||||
HWND filesListScroll;
|
||||
HWND searchBox;
|
||||
HWND searchBtn;
|
||||
HWND playButton;
|
||||
HWND stopButton;
|
||||
HWND npLabel;
|
||||
HWND autoPlayCheck;
|
||||
HMENU menuBar;
|
||||
|
||||
//HOOKS
|
||||
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK JumpToProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
bool alphabeticSort(WIN32_FIND_DATA a, WIN32_FIND_DATA b);
|
||||
|
||||
//EXECUTION PART
|
||||
//ENTRY POINT
|
||||
int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLine, int nCmdShow) {
|
||||
globalInstance = currentInst;
|
||||
WNDCLASSEX windowClass = EzCreateClass(L"Easy Audio Player", WndProc, currentInst, NULL, IDC_ARROW);
|
||||
windowClass.hIcon = (HICON)LoadImage(currentInst, L"Easy Audio Player.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_SHARED);
|
||||
windowClass.hIconSm = (HICON)LoadImage(currentInst, L"Easy Audio Player.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_SHARED);
|
||||
|
||||
//CREATE & REGISTER WINDOW CLASS
|
||||
WNDCLASSEX windowClass = { 0 };
|
||||
windowClass.cbSize = sizeof(WNDCLASSEX);
|
||||
windowClass.lpfnWndProc = WndProc;
|
||||
windowClass.hInstance = currentInst;
|
||||
windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
windowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW);
|
||||
windowClass.lpszClassName = PROGRAM_NAME;
|
||||
windowClass.hIcon = (HICON)LoadImage(currentInst, L"ClickPlay.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_SHARED);
|
||||
windowClass.hIconSm = (HICON)LoadImage(currentInst, L"small.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_SHARED);
|
||||
if (!RegisterClassEx(&windowClass)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
//LOAD KEYBOARD SHORTCUT TABLE
|
||||
HACCEL shortcuts = LoadAccelerators(currentInst, MAKEINTRESOURCE(IDC_CLICKPLAY));
|
||||
|
||||
//LOAD MENU BAR
|
||||
menuBar = LoadMenu(currentInst, (LPCWSTR)IDC_MENU);
|
||||
mainWindow = EzCreateWindow(windowClass,currentInst,L"Easy Audio Player", WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 400, 620, NULL, menuBar);
|
||||
|
||||
//CREATE MAIN WINDOW
|
||||
mainWindow = CreateWindowEx(WS_EX_CLIENTEDGE, windowClass.lpszClassName, PROGRAM_NAME, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 400, 620, NULL, menuBar, currentInst, NULL);
|
||||
SendMessage(mainWindow, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, NULL);
|
||||
ShowWindow(mainWindow, nCmdShow);
|
||||
UpdateWindow(mainWindow);
|
||||
|
||||
//INITIALIZE MESSAGE LOOP
|
||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
if (!TranslateAccelerator(mainWindow, shortcuts, &msg)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
void CreateControls(HWND window) {
|
||||
dirLabel = EzCreateLabel(L"Nie wybrano folderu", 10, 10, 250, 40, window, FALSE);
|
||||
SendMessage(dirLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
browseButton = EzCreateButton(L"Przegl¹daj", 275, 10, 100, 30, window, NULL);
|
||||
SendMessage(browseButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
filesListCtrl = CreateWindowEx(0, L"LISTBOX", NULL, LBS_STANDARD | WS_CHILD | WS_VISIBLE, 0, 50, 400, 425, window, (HMENU)IDC_LIST, NULL, NULL);
|
||||
SendMessage(filesListCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
npLabel = EzCreateLabel(NOT_PLAYING_LABEL, -5, 460, 400, 30, window, SS_CENTER | WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE);
|
||||
SendMessage(npLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
playButton = EzCreateButton(PLAY_LABEL, 75, 515, 100, 30, window, NULL);
|
||||
SendMessage(playButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
stopButton = EzCreateButton(L"Zatrzymaj", 195, 515, 100, 30, window, NULL);
|
||||
SendMessage(stopButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
autoPlayCheck = CreateWindowEx(NULL, L"BUTTON", L"Odtwarzaj automatycznie", BS_CHECKBOX | WS_VISIBLE | WS_CHILD | SS_CENTER | SS_CENTERIMAGE, 105, 485, 170, 30, window, NULL, NULL, NULL);
|
||||
SendMessage(autoPlayCheck, BM_SETCHECK, BST_CHECKED, NULL);
|
||||
SendMessage(autoPlayCheck, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
filesListScroll = CreateWindowEx(0, L"SCROLLBAR", NULL, WS_CHILD | WS_VISIBLE | SBS_VERT, 300, 50, 50, 425, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
void GetFiles(TCHAR* path, wstring ext) {
|
||||
if (path[0] != NULL) {
|
||||
wstringstream findPathStream;
|
||||
findPathStream << wstring(path);
|
||||
findPathStream << L"\\*.";
|
||||
findPathStream << ext;
|
||||
wstring findPathS = findPathStream.str();
|
||||
LPCWSTR findPath = findPathS.c_str();
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind = FindFirstFile(findPath, &data);
|
||||
|
||||
if (hFind != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
SendMessage(filesListCtrl, LB_ADDSTRING, NULL, (LPARAM)data.cFileName);
|
||||
} while (FindNextFile(hFind, &data));
|
||||
EnableWindow(filesListCtrl, TRUE);
|
||||
//CREATE CONTROLS
|
||||
void CreateControls(HWND window) {
|
||||
dirLabel = CreateWindowEx(0, L"STATIC", NO_DIR_LOADED_LABEL, WS_CHILD | WS_VISIBLE, 10, 10, 250, 40, window, (HMENU)IDC_DIRLABEL, globalInstance, NULL);
|
||||
SendMessage(dirLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
browseButton = CreateWindowEx(0, L"BUTTON", L"Przegl¹daj", WS_CHILD | WS_VISIBLE, 275, 10, 100, 30, window, (HMENU)IDC_BROWSEBTN, globalInstance, NULL);
|
||||
SendMessage(browseButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
filesListCtrl = CreateWindowEx(0, L"LISTBOX", NULL, LBS_NOTIFY | LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_VSCROLL, 0, 50, 380, 425, window, (HMENU)IDC_LIST, globalInstance, NULL);
|
||||
SendMessage(filesListCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
searchBox = CreateWindowEx(0, L"EDIT", L"", WS_CHILD | WS_VISIBLE, 0, 460, 300, 25, window, (HMENU)IDC_SEARCH, globalInstance, NULL);
|
||||
SendMessage(searchBox, EM_SETCUEBANNER, FALSE, (LPARAM)L"Wyszukaj pliki...");
|
||||
SendMessage(searchBox, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
searchBtn = CreateWindowEx(0, L"BUTTON", L"Szukaj", WS_CHILD | WS_VISIBLE, 300, 460, 80, 25, window, (HMENU)IDC_SEARCHBTN, globalInstance, NULL);
|
||||
SendMessage(searchBtn, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
npLabel = CreateWindowEx(0, L"STATIC", NOT_PLAYING_LABEL, SS_CENTER | WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, -5, 485, 400, 25, window, (HMENU)IDC_NPLABEL, globalInstance, NULL);
|
||||
SendMessage(npLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
playButton = CreateWindowEx(0, L"BUTTON", PLAY_LABEL, WS_CHILD | WS_VISIBLE, 75, 515, 100, 30, window, (HMENU)IDC_PLAYBTN, globalInstance, NULL);
|
||||
SendMessage(playButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
stopButton = CreateWindowEx(0, L"BUTTON", L"Zatrzymaj", WS_CHILD | WS_VISIBLE, 195, 515, 100, 30, window, (HMENU)IDC_STOPBTN, globalInstance, NULL);
|
||||
SendMessage(stopButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
}
|
||||
|
||||
//GET SELECTED INDEX
|
||||
int GetIndex() {
|
||||
LRESULT listItemsCount = SendMessage(filesListCtrl, LB_GETCOUNT, NULL, NULL);
|
||||
for (int i = 0; i < listItemsCount; i++) {
|
||||
if (SendMessage(filesListCtrl, LB_GETSEL, (WPARAM)i, NULL) > 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
BOOL FolderBrowseDialog(HWND window) {
|
||||
|
||||
//REMOVE SELECTION
|
||||
void UnloadSelection() {
|
||||
mciSendString(L"close mp3", NULL, 0, mainWindow);
|
||||
selected = -1;
|
||||
}
|
||||
|
||||
//LOAD SELECTION
|
||||
/*
|
||||
* ERROR CODES
|
||||
* -1 - invalid index
|
||||
* -2 - file not found
|
||||
* -3 - path not loaded
|
||||
* -4 - file loading error
|
||||
*/
|
||||
int LoadSelection(int index) {
|
||||
UnloadSelection();
|
||||
if (index >= 0) {
|
||||
if (!path.empty()) {
|
||||
wstring fullPath = path + L"\\" + wstring(files[index].cFileName);
|
||||
WIN32_FIND_DATA fileData;
|
||||
HANDLE fileExist = FindFirstFile(fullPath.c_str(), &fileData);
|
||||
if (fileExist == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(mainWindow, L"Wskazany plik nie zosta³ odnaleziony. Upewnij siê, ¿e nie zosta³ przeniesiony lub usuniêty. Naciœnij klawisz F5, aby odœwie¿yæ listê i pozbyæ siê niedzia³aj¹cych pozycji.", L"Nie znaleziono pliku", MB_ICONERROR);
|
||||
return -2;
|
||||
}
|
||||
else {
|
||||
wstring fullCommandS = L"open \"" + fullPath + L"\" type mpegvideo alias mp3";
|
||||
LPCWSTR fullCommand = fullCommandS.c_str();
|
||||
|
||||
if (mciSendString(fullCommand, NULL, 0, mainWindow) != 0) {
|
||||
UnloadSelection();
|
||||
MessageBox(mainWindow, L"Nieznany b³¹d uniemo¿liwia odtworzenie tego pliku. SprawdŸ czy plik nie jest uszkodzony.", L"B³¹d wczytywania", MB_ICONERROR);
|
||||
return -4;
|
||||
}
|
||||
selected = index;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"Naruszenie dostêpu do stanu programu. Proces zostanie zakoñczony.", L"B³¹d krytyczny", MB_ICONERROR);
|
||||
ExitProcess(0);
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//FILL THE LIST BOX
|
||||
void GenerateList(vector<WIN32_FIND_DATA> list) {
|
||||
SendMessage(filesListCtrl, LB_RESETCONTENT, NULL, NULL);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
wstring fileName = list[i].cFileName;
|
||||
if (!showExtensions) {
|
||||
int dotPos = fileName.find_last_of('.');
|
||||
fileName.erase(dotPos, 4);
|
||||
}
|
||||
SendMessage(filesListCtrl, LB_ADDSTRING, NULL, (LPARAM)fileName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
//UNLOAD DIRECTORY
|
||||
void UnloadDir() {
|
||||
SendMessage(filesListCtrl, LB_RESETCONTENT, NULL, NULL);
|
||||
path.clear();
|
||||
files.clear();
|
||||
if (selected != -1) {
|
||||
UnloadSelection();
|
||||
}
|
||||
}
|
||||
|
||||
//LOAD DIRECTORY
|
||||
/*
|
||||
* ERROR CODES
|
||||
* -1 - empty string
|
||||
* -2 - invalid directory
|
||||
* -3 - empty directory
|
||||
*/
|
||||
int LoadDir(wstring dir) {
|
||||
UnloadDir();
|
||||
if (!dir.empty()) {
|
||||
DWORD dirA = GetFileAttributes(dir.c_str());
|
||||
if (dirA & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
for (int i = 0; i < EXT_LENGTH; i++) {
|
||||
wstring findPathS = dir + L"\\*." + ext[i];
|
||||
LPCWSTR findPath = findPathS.c_str();
|
||||
WIN32_FIND_DATA dirData;
|
||||
HANDLE finder = FindFirstFile(findPath, &dirData);
|
||||
if (finder != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
files.push_back(dirData);
|
||||
} while (FindNextFile(finder, &dirData));
|
||||
}
|
||||
}
|
||||
if (files.empty()) {
|
||||
MessageBox(mainWindow, L"Wygl¹da na to, ¿e w tym katalogu nie ma ¿adnych plików, które mog¹ zostaæ otwarte przez program. Wybierz inny folder i spróbuj ponownie.", L"Brak plików", MB_ICONEXCLAMATION);
|
||||
files.clear();
|
||||
return -3;
|
||||
}
|
||||
std::sort(files.begin(), files.end(), alphabeticSort);
|
||||
GenerateList(files);
|
||||
path = dir;
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"Program nie mo¿e uzyskaæ dostêpu do wskazanego katalogu.", L"Nieprawid³owy katalog", MB_ICONERROR);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"Nie wczytano katalogu. U¿yj przycisku PRZEGL¥DAJ, aby za³adaowaæ katalog.", L"Brak katalogu", MB_ICONERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//INITALIZE FOLDER PICKER
|
||||
int FolderBrowseDialog(HWND window) {
|
||||
BROWSEINFO dialog = { 0 };
|
||||
dialog.hwndOwner = window;
|
||||
dialog.ulFlags = BIF_NEWDIALOGSTYLE;
|
||||
dialog.lpszTitle = L"Wybierz folder, który ma zostaæ otwarty przez program";
|
||||
dialog.lpszTitle = L"Wybierz katalog, który ma zostaæ otwarty przez program...";
|
||||
LPITEMIDLIST pid = SHBrowseForFolder(&dialog);
|
||||
TCHAR currentPath[MAX_PATH];
|
||||
if (pid != 0) {
|
||||
SHGetPathFromIDList(pid, path);
|
||||
SetCurrentDirectory(path);
|
||||
SetWindowText(dirLabel, path);
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
void Play(TCHAR* path, TCHAR* fileName) {
|
||||
if (path[0] != NULL && selected != NULL) {
|
||||
//STOP PREVIOUS PLAYBACKS
|
||||
mciSendString(L"close mp3", NULL, 0, NULL);
|
||||
|
||||
//GET PATH
|
||||
wstring fullPath = wstring(path) + L"\\" + wstring(selected);
|
||||
WIN32_FIND_DATA fileData;
|
||||
HANDLE fileExist = FindFirstFile(fullPath.c_str(), &fileData);
|
||||
if (fileExist == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(mainWindow, L"Podany plik nie zosta³ odnaleziony. Upewnij siê, ¿e plik istnieje lub nie zosta³ przeniesiony.", L"Nie znaleziono pliku", MB_ICONERROR);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
return;
|
||||
SHGetPathFromIDList(pid, currentPath);
|
||||
if (LoadDir((wstring)currentPath) == 0) {
|
||||
SetCurrentDirectory(path.c_str());
|
||||
SetWindowText(dirLabel, path.c_str());
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return -2;
|
||||
}
|
||||
|
||||
//PROCESS COMMAND
|
||||
wstringstream fullCommandStream;
|
||||
fullCommandStream << "open \"";
|
||||
fullCommandStream << fullPath;
|
||||
fullCommandStream << "\" type mpegvideo alias mp3";
|
||||
wstring fullCommandS = fullCommandStream.str();
|
||||
LPCWSTR fullCommand = fullCommandS.c_str();
|
||||
|
||||
//PLAY THE SOUND
|
||||
mciSendString(fullCommand, NULL, 0, NULL);
|
||||
mciSendString(L"play mp3 notify", NULL, 0, mainWindow);
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"Podczas odtwarzania wyst¹pi³ b³¹d. SprawdŸ czy podany plik istnieje.", L"Wyst¹pi³ b³¹d", MB_ICONERROR);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//SEARCH DIRECTORY
|
||||
/*ERROR CODES
|
||||
* -1 - no files found
|
||||
* -2 - LoadDir error
|
||||
* -3 - empty input
|
||||
*/
|
||||
int SearchDir(wstring phrase) {
|
||||
//PERFORM CHECKING
|
||||
if (path.empty()) {
|
||||
return -2;
|
||||
}
|
||||
if (phrase == currentSearchPhrase) {
|
||||
return 0;
|
||||
}
|
||||
//RELOAD DIR
|
||||
if (LoadDir(path) != 0) {
|
||||
return -2;
|
||||
}
|
||||
if (phrase.empty()) {
|
||||
return -3;
|
||||
}
|
||||
vector<WIN32_FIND_DATA> results;
|
||||
//GET FILES
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
if (wstring(files[i].cFileName).find(phrase) != wstring::npos) {
|
||||
results.push_back(files[i]);
|
||||
}
|
||||
}
|
||||
if (results.empty()) {
|
||||
MessageBox(mainWindow, L"Nie znaleziono plików zawieraj¹cych wpisan¹ frazê.", L"Brak plików", MB_ICONEXCLAMATION);
|
||||
currentSearchPhrase.clear();
|
||||
return -1;
|
||||
}
|
||||
std::sort(results.begin(), results.end(), alphabeticSort);
|
||||
files = results;
|
||||
currentSearchPhrase = phrase;
|
||||
//ADD FILTERED CONTENT
|
||||
GenerateList(files);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//GET SEARCH PHRASE FROM searchBox
|
||||
wstring GetSearchPhrase() {
|
||||
__int64 searchLength = SendMessage(searchBox, WM_GETTEXTLENGTH, 0, NULL);
|
||||
TCHAR* searchPhrase = new TCHAR[searchLength + 1];
|
||||
SendMessage(searchBox, WM_GETTEXT, searchLength + 1, (LPARAM)searchPhrase);
|
||||
searchPhrase[(int)searchLength] = _T('\0');
|
||||
return wstring(searchPhrase);
|
||||
}
|
||||
|
||||
//MESSAGE LOOP
|
||||
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
int windowId, windowEvent;
|
||||
int windowId, windowEvent, randIndex;
|
||||
switch (msg) {
|
||||
case WM_CLOSE:
|
||||
DestroyWindow(hwnd);
|
||||
@@ -179,72 +358,66 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
case WM_COMMAND:
|
||||
windowId = LOWORD(wParam);
|
||||
windowEvent = HIWORD(wParam);
|
||||
if (windowId == IDC_LIST) {
|
||||
if (windowEvent == LBN_SELCHANGE) {
|
||||
LRESULT listItemsCount = SendMessage(filesListCtrl, LB_GETCOUNT, NULL, NULL);
|
||||
int selectedItemIndex = -1;
|
||||
for (int i = 0; i < listItemsCount; i++) {
|
||||
if (SendMessage(filesListCtrl, LB_GETSEL, (WPARAM)i, NULL) > 0) {
|
||||
selectedItemIndex = i;
|
||||
|
||||
switch (windowId) {
|
||||
case ID_PLIK_OPENDIR:
|
||||
case IDC_BROWSEBTN:
|
||||
switch (FolderBrowseDialog(mainWindow)) {
|
||||
case 0:
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
break;
|
||||
case -2:
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, NULL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case IDC_LIST:
|
||||
if (windowEvent == LBN_SELCHANGE) {
|
||||
if (selected != SendMessage(filesListCtrl, LB_GETCURSEL, 0, 0)) {
|
||||
if (currentState == 1 || currentState == 2) { currentState = 1; isQueued = TRUE; }
|
||||
if (LoadSelection(GetIndex()) == 0) {
|
||||
if (isOnClickPlayEnabled == TRUE) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedItemIndex != -1) {
|
||||
LRESULT selectedLength = SendMessage(filesListCtrl, LB_GETTEXTLEN, (WPARAM)selectedItemIndex, NULL);
|
||||
selected = new TCHAR[selectedLength];
|
||||
SendMessage(filesListCtrl, LB_GETTEXT, (WPARAM)selectedItemIndex, (LPARAM)selected);
|
||||
break;
|
||||
case IDC_SEARCHBTN:
|
||||
if (SearchDir(GetSearchPhrase()) == -2) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
if (isAutoPlayEnabled == TRUE) {
|
||||
Play(path, selected);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
}
|
||||
if (windowEvent == LBN_SELCANCEL) {
|
||||
selected = NULL;
|
||||
}
|
||||
}
|
||||
if ((HWND)lParam == browseButton) {
|
||||
if (FolderBrowseDialog(mainWindow) == TRUE) {
|
||||
mciSendString(L"close mp3", NULL, 0, NULL);
|
||||
break;
|
||||
case IDC_PLAYBTN:
|
||||
switch (currentState) {
|
||||
case 0:
|
||||
if (LoadSelection(GetIndex()) == 0) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
SendMessage(mainWindow, STATE_CHANGE, 2, NULL);
|
||||
break;
|
||||
case 2:
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case IDC_STOPBTN:
|
||||
isQueued = FALSE;
|
||||
UnloadSelection();
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
SendMessage(filesListCtrl, LB_RESETCONTENT, NULL, NULL);
|
||||
for (int i = 0; i < EXT_LENGTH; i++) {
|
||||
GetFiles(path, ext[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((HWND)lParam == autoPlayCheck) {
|
||||
if (isAutoPlayEnabled) {
|
||||
SendMessage(autoPlayCheck, BM_SETCHECK, BST_UNCHECKED, NULL);
|
||||
isAutoPlayEnabled = FALSE;
|
||||
}
|
||||
else {
|
||||
SendMessage(autoPlayCheck, BM_SETCHECK, BST_CHECKED, NULL);
|
||||
isAutoPlayEnabled = TRUE;
|
||||
}
|
||||
}
|
||||
else if ((HWND)lParam == stopButton) {
|
||||
mciSendString(L"close mp3", NULL, 0, NULL);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
}
|
||||
else if ((HWND)lParam == playButton) {
|
||||
switch (currentState) {
|
||||
case 0:
|
||||
Play(path, selected);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
break;
|
||||
case 1:
|
||||
mciSendString(L"pause mp3", NULL, 0, NULL);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 2, NULL);
|
||||
break;
|
||||
case 2:
|
||||
mciSendString(L"resume mp3", NULL, 0, NULL);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (wParam) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, -1, 0);
|
||||
break;
|
||||
case IDM_EXIT:
|
||||
SendMessage(mainWindow, WM_CLOSE, NULL, NULL);
|
||||
break;
|
||||
@@ -252,68 +425,298 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
DialogBox(globalInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), mainWindow, About);
|
||||
break;
|
||||
case ID_REFRESH:
|
||||
if (path[0] != NULL) {
|
||||
SendMessage(filesListCtrl, LB_RESETCONTENT, NULL, NULL);
|
||||
for (int i = 0; i < EXT_LENGTH; i++) {
|
||||
GetFiles(path, ext[i]);
|
||||
if (LoadDir(path) != 0) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
if (SendMessage(searchBox, WM_GETTEXTLENGTH, 0, 0) > 0) {
|
||||
if (SearchDir(GetSearchPhrase()) == -2) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"Nie za³adowano folderu. Naciœnij przycisk PRZEGL¥DAJ, aby wczytaæ katalog.", L"Brak katalogu", MB_ICONERROR);
|
||||
break;
|
||||
case ID_OPCJE_ONCLICK:
|
||||
if (isOnClickPlayEnabled) {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_ONCLICK, MF_UNCHECKED);
|
||||
isOnClickPlayEnabled = FALSE;
|
||||
}
|
||||
else {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_ONCLICK, MF_CHECKED);
|
||||
isOnClickPlayEnabled = TRUE;
|
||||
}
|
||||
break;
|
||||
case ID_OPCJE_LOOP:
|
||||
if (isLoopEnabled) {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_LOOP, MF_UNCHECKED);
|
||||
isLoopEnabled = FALSE;
|
||||
}
|
||||
else {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_LOOP, MF_CHECKED);
|
||||
isLoopEnabled = TRUE;
|
||||
}
|
||||
UnloadSelection();
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, -1, 0);
|
||||
break;
|
||||
case ID_OPCJE_SHOWEXT:
|
||||
if (showExtensions) {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_SHOWEXT, MF_UNCHECKED);
|
||||
showExtensions = FALSE;
|
||||
}
|
||||
else {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_SHOWEXT, MF_CHECKED);
|
||||
showExtensions = TRUE;
|
||||
}
|
||||
if (!path.empty() && !files.empty()) {
|
||||
GenerateList(files);
|
||||
if (selected != -1) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, selected, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ID_PLIK_CLOSEDIR:
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, NULL);
|
||||
break;
|
||||
case ID_AKCJE_SRCLEAR:
|
||||
currentSearchPhrase.clear();
|
||||
SendMessage(searchBox, WM_SETTEXT, (WPARAM)L"", 0);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
if (LoadDir(path) != 0) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
break;
|
||||
case ID_AKCJE_RANDOM:
|
||||
if (currentState == 1) {
|
||||
isQueued = TRUE;
|
||||
}
|
||||
//GET SEED
|
||||
srand(time(NULL));
|
||||
//LOAD AND PLAY
|
||||
randIndex = rand() % files.size();
|
||||
if (randIndex == selected && randIndex + 1 < files.size()) { randIndex += 1; }
|
||||
if (LoadSelection(randIndex) == 0) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, randIndex, 0);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, 0);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
break;
|
||||
case ID_OPCJE_AUTOPLAY:
|
||||
if (isAutoPlayEnabled) {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_AUTOPLAY, MF_UNCHECKED);
|
||||
isAutoPlayEnabled = FALSE;
|
||||
}
|
||||
else {
|
||||
CheckMenuItem(menuBar, ID_OPCJE_AUTOPLAY, MF_CHECKED);
|
||||
isAutoPlayEnabled = TRUE;
|
||||
}
|
||||
UnloadSelection();
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, -1, 0);
|
||||
break;
|
||||
case ID_AKCJE_JUMP:
|
||||
DialogBox(globalInstance, MAKEINTRESOURCE(IDD_JUMPTODIALOG), mainWindow, JumpToProc);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case MM_MCINOTIFY:
|
||||
mciSendString(L"close mp3", NULL, 0, NULL);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
if (!isQueued) {
|
||||
if (isAutoPlayEnabled) {
|
||||
if (selected != -1 && !(selected + 1 > files.size() - 1)) {
|
||||
if (LoadSelection(selected + 1) == 0) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, selected, 0);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, 0);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
}
|
||||
else if(isLoopEnabled && selected != -1) {
|
||||
if (LoadSelection(0) == 0) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, selected, 0);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, 0);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (selected != -1) {
|
||||
UnloadSelection();
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, -1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (selected != -1) {
|
||||
UnloadSelection();
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, -1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
isQueued = FALSE;
|
||||
}
|
||||
break;
|
||||
case STATE_CHANGE:
|
||||
currentState = (int)wParam;
|
||||
switch (currentState) {
|
||||
switch ((int)wParam) {
|
||||
case -1:
|
||||
UnloadSelection();
|
||||
UnloadDir();
|
||||
|
||||
EnableWindow(filesListCtrl, FALSE);
|
||||
EnableWindow(playButton, FALSE);
|
||||
EnableWindow(stopButton, FALSE);
|
||||
SetWindowText(npLabel, L"-");
|
||||
EnableWindow(filesListCtrl, FALSE);
|
||||
SetWindowText(playButton, PLAY_LABEL);
|
||||
EnableWindow(searchBtn, FALSE);
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_DISABLED);
|
||||
EnableMenuItem(menuBar, ID_PLIK_CLOSEDIR, MF_DISABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_RANDOM, MF_DISABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_SRCLEAR, MF_DISABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_JUMP, MF_DISABLED);
|
||||
SetWindowText(dirLabel, NO_DIR_LOADED_LABEL);
|
||||
SetWindowText(npLabel, NOT_PLAYING_LABEL);
|
||||
SetWindowText(playButton, PLAY_LABEL);
|
||||
break;
|
||||
case 0:
|
||||
EnableWindow(playButton, TRUE);
|
||||
EnableWindow(stopButton, TRUE);
|
||||
SetWindowText(npLabel, NOT_PLAYING_LABEL);
|
||||
EnableWindow(filesListCtrl, TRUE);
|
||||
SetWindowText(playButton, PLAY_LABEL);
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_ENABLED);
|
||||
break;
|
||||
if (!path.empty()) {
|
||||
EnableWindow(filesListCtrl, TRUE);
|
||||
EnableWindow(playButton, TRUE);
|
||||
EnableWindow(stopButton, TRUE);
|
||||
EnableWindow(searchBtn, TRUE);
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_PLIK_CLOSEDIR, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_RANDOM, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_SRCLEAR, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_JUMP, MF_DISABLED);
|
||||
SetWindowText(npLabel, NOT_PLAYING_LABEL);
|
||||
SetWindowText(playButton, PLAY_LABEL);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
EnableWindow(playButton, TRUE);
|
||||
EnableWindow(stopButton, TRUE);
|
||||
SetWindowText(npLabel, selected);
|
||||
EnableWindow(filesListCtrl, FALSE);
|
||||
SetWindowText(playButton, PAUSE_LABEL);
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_DISABLED);
|
||||
break;
|
||||
if (!path.empty() && selected != -1) {
|
||||
int playerState = 0;
|
||||
if (currentState == 2) {
|
||||
playerState = mciSendString(L"resume mp3", NULL, 0, mainWindow);
|
||||
}
|
||||
else {
|
||||
if (isLoopEnabled && !isAutoPlayEnabled) {
|
||||
playerState = mciSendString(L"play mp3 repeat", NULL, 0, mainWindow);
|
||||
}
|
||||
else {
|
||||
playerState = mciSendString(L"play mp3 notify", NULL, 0, mainWindow);
|
||||
}
|
||||
}
|
||||
|
||||
if (playerState != 0) {
|
||||
MessageBox(mainWindow, L"Nie uda³o siê odtworzyæ wskazanego pliku. SprawdŸ czy plik nie jest uszkodzony.", L"B³¹d odtwarzania", MB_ICONERROR);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
EnableWindow(filesListCtrl, TRUE);
|
||||
EnableWindow(playButton, TRUE);
|
||||
EnableWindow(stopButton, TRUE);
|
||||
EnableWindow(searchBtn, TRUE);
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_DISABLED);
|
||||
EnableMenuItem(menuBar, ID_PLIK_CLOSEDIR, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_RANDOM, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_SRCLEAR, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_JUMP, MF_ENABLED);
|
||||
SetWindowText(npLabel, files[selected].cFileName);
|
||||
SetWindowText(playButton, PAUSE_LABEL);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
mciSendString(L"pause mp3", NULL, 0, mainWindow);
|
||||
|
||||
wstring pauseStringWS = wstring(files[selected].cFileName) + L" [PAUZA]";
|
||||
LPCWSTR pauseString = pauseStringWS.c_str();
|
||||
|
||||
EnableWindow(filesListCtrl, TRUE);
|
||||
EnableWindow(playButton, TRUE);
|
||||
EnableWindow(stopButton, TRUE);
|
||||
wstringstream pauseStringS;
|
||||
pauseStringS << wstring(selected);
|
||||
pauseStringS << " [PAUZA]";
|
||||
wstring pauseStringWS = pauseStringS.str();
|
||||
LPCWSTR pauseString = pauseStringWS.c_str();
|
||||
EnableWindow(searchBtn, TRUE);
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_DISABLED);
|
||||
EnableMenuItem(menuBar, ID_PLIK_CLOSEDIR, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_RANDOM, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_SRCLEAR, MF_ENABLED);
|
||||
EnableMenuItem(menuBar, ID_AKCJE_JUMP, MF_ENABLED);
|
||||
SetWindowText(npLabel, pauseString);
|
||||
SetWindowText(playButton, L"Wznów");
|
||||
EnableMenuItem(menuBar, ID_REFRESH, MF_DISABLED);
|
||||
EnableWindow(filesListCtrl, FALSE);
|
||||
break;
|
||||
}
|
||||
currentState = (int)wParam;
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//JUMP TO DIALOG LOOP
|
||||
INT_PTR CALLBACK JumpToProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
SetDlgItemText(hwnd, IDC_TSMIN, L"00");
|
||||
SetDlgItemText(hwnd, IDC_TSSEC, L"00");
|
||||
return (INT_PTR)TRUE;
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK) {
|
||||
TCHAR* minB = new TCHAR[32];
|
||||
TCHAR* secB = new TCHAR[32];
|
||||
|
||||
GetDlgItemText(hwnd, IDC_TSMIN, minB, 30);
|
||||
GetDlgItemText(hwnd, IDC_TSSEC, secB, 30);
|
||||
|
||||
int min = 0;
|
||||
int sec = 0;
|
||||
|
||||
try {
|
||||
min = std::stoi(minB);
|
||||
sec = std::stoi(secB);
|
||||
|
||||
if (!(min >= 0 && min <= 999 && sec >= 0 && sec <= 59)) {
|
||||
MessageBox(mainWindow, L"Podane wartoœci s¹ niepoprawne", L"Niepoprawne wartoœci", MB_ICONEXCLAMATION);
|
||||
EndDialog(hwnd, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
MessageBox(mainWindow, L"Podane wartoœci s¹ niepoprawne", L"Niepoprawne wartoœci", MB_ICONEXCLAMATION);
|
||||
EndDialog(hwnd, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
|
||||
int timestamp = (((min * 60) + sec) * 1000);
|
||||
|
||||
isQueued = TRUE;
|
||||
wstring mciCmd = L"play mp3 from " + std::to_wstring(timestamp);
|
||||
mciSendString(mciCmd.c_str(), NULL, 0, mainWindow);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, 0);
|
||||
|
||||
EndDialog(hwnd, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
else if (LOWORD(wParam) == IDCANCEL) {
|
||||
EndDialog(hwnd, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
||||
|
||||
//ABOUT DIALOG LOOP
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (message) {
|
||||
@@ -327,4 +730,40 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
||||
|
||||
//SORTING FUNCTION
|
||||
bool alphabeticSort(WIN32_FIND_DATA a, WIN32_FIND_DATA b) {
|
||||
wstring aStr = a.cFileName;
|
||||
wstring bStr = b.cFileName;
|
||||
wstring aBuf;
|
||||
wstring bBuf;
|
||||
int aNum = 0;
|
||||
int bNum = 0;
|
||||
for (int i = 0; i < aStr.size(); i++) {
|
||||
if (std::isdigit(static_cast<unsigned char>(aStr.at(i)))) {
|
||||
aBuf += aStr.at(i);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < bStr.size(); i++) {
|
||||
if (std::isdigit(static_cast<unsigned char>(bStr.at(i)))) {
|
||||
bBuf += bStr.at(i);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!aBuf.empty()) {
|
||||
aNum = std::stoi(aBuf);
|
||||
}
|
||||
if (!bBuf.empty()) {
|
||||
bNum = std::stoi(bBuf);
|
||||
}
|
||||
if (aNum != 0 || bNum != 0) {
|
||||
return aNum < bNum;
|
||||
}
|
||||
return std::tolower(aStr.at(0)) < std::tolower(bStr.at(0));
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by ClickPlay.rc
|
||||
//
|
||||
#define IDD_CLICKPLAY_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_CLICKPLAY 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_CLICKPLAY 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_JUMPTODIALOG 130
|
||||
#define IDC_MENU 200
|
||||
#define IDC_SEARCHBTN 205
|
||||
#define IDC_PLAYBTN 207
|
||||
#define IDC_STOPBTN 208
|
||||
#define IDC_TSSEC 1000
|
||||
#define IDC_TSMIN 1001
|
||||
#define ID_REFRESH 32775
|
||||
#define ID_OPCJE_ONCLICK 32776
|
||||
#define ID_OPCJE_LOOP 32777
|
||||
#define ID_PLIK_CLOSEDIR 32778
|
||||
#define ID_AKCJE_SRCLEAR 32779
|
||||
#define ID_PLIK_OPENDIR 32780
|
||||
#define ID_AKCJE_RANDOM 32781
|
||||
#define ID_OPCJE_SHOWEXT 32782
|
||||
#define ID_OPCJE_AUTOPLAY 32783
|
||||
#define ID_AKCJE_JUMP 32784
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||
#define _APS_NEXT_COMMAND_VALUE 32785
|
||||
#define _APS_NEXT_CONTROL_VALUE 1002
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
||||
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 31 KiB |
@@ -1,6 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
// // Uwzględnienie elementu SDKDDKVer.h powoduje zdefiniowanie najnowszej dostępnej platformy systemu Windows.
|
||||
// Jeśli chcesz skompilować aplikację dla poprzedniej platformy systemu Windows, uwzględnij element WinSDKVer.h i
|
||||
// ustaw makro _WIN32_WINNT na platformę, która ma być obsługiwana, przed uwzględnieniem elementu SDKDDKVer.h.
|
||||
#include <SDKDDKVer.h>
|
||||