diff --git a/LameXP_VS2012.vcxproj b/LameXP_VS2012.vcxproj index 860b1e0c..a59b26ff 100644 --- a/LameXP_VS2012.vcxproj +++ b/LameXP_VS2012.vcxproj @@ -312,6 +312,7 @@ del "$(TargetDir)imageformats\q???d4.dll" + @@ -557,6 +558,7 @@ del "$(TargetDir)imageformats\q???d4.dll" $(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs) $(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)" diff --git a/LameXP_VS2012.vcxproj.filters b/LameXP_VS2012.vcxproj.filters index 0da3bd7c..d44ca487 100644 --- a/LameXP_VS2012.vcxproj.filters +++ b/LameXP_VS2012.vcxproj.filters @@ -388,6 +388,9 @@ Generated Files\MOC + + Source Files\Misc + @@ -516,7 +519,7 @@ Header Files\Decoders - + Header Files\Misc @@ -710,6 +713,7 @@ Dialogs + diff --git a/doc/Changelog.html b/doc/Changelog.html index 0f802cdb..6d5f7256 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -17,6 +17,11 @@ a:visited { color: #0000EE; }

LameXP - Version History


+Changes between v4.08 and v4.09 [unreleased]:
    +
  • Improved internal encoder API, so each encoder can define its own configuration options +
  • Complete overhaul of the file analyzer, resulting in up to 2.5x faster file import speed +

+ Changes between v4.07 and v4.08 [2013-09-04]:
  • Upgraded build environment to Microsoft Visual Studio 2012 with Update-3
  • Encoder settings (RC mode + bitrate/quality) are now stored separately for each encoder diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 5fcd5121..e4e0dc3c 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -54,324 +54,324 @@ - + LameXP - Audio Encoder Front-end - + Please visit %1 for news and updates! - - + + Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left. - + Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!! - + The following people have contributed to LameXP: - + Programmers: - + Project Leader - + Translators: - + Special thanks to: - + Doom9's Forum - + Gleitz | German Doom9 - + Hydrogenaudio Forums - + RareWares - + GitHub - + SourceForge - + Qt Developer Network - + Marius Hudea - + Codecs.com - + If you are willing to contribute a LameXP translation, feel free to contact us! - + The following third-party software is used in LameXP: - + LAME - OpenSource mp3 Encoder - - - - - - - - - - - - + + + + + + + + + + + + Released under the terms of the GNU Lesser General Public License. - + OggEnc - Ogg Vorbis Encoder - + Completely open and patent-free audio encoding technology. - + Nero AAC Reference MPEG-4 Encoder - + Freeware state-of-the-art HE-AAC encoder with 2-Pass support. - + Available from vendor web-site as free download: - + Aften - A/52 audio encoder - + FLAC - Free Lossless Audio Codec - + Open and patent-free lossless audio compression technology. - + Opus Audio Codec - + Totally open, royalty-free, highly versatile audio codec. - + mpg123 - Fast Console MPEG Audio Player/Decoder - + FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder - + Released under the terms of the GNU General Public License. - + Valdec from AC3Filter Tools - AC3/DTS Decoder - + WavPack - Hybrid Lossless Compression - + Completely open audio compression format. - + Musepack - Living Audio Compression - + Monkey's Audio - Lossless Audio Compressor - + Freely available source code, simple SDK and non-restrictive licensing. - + Shorten - Lossless Audio Compressor - + Speex - Free Codec For Free Speech - + Open Source patent-free audio format designed for speech. - + The True Audio - Lossless Audio Codec - + refalac - Win32 command line ALAC encoder/decoder - + The ALAC reference implementation by Apple is available under the Apache license. - + wma2wav - Dump WMA files to Wave Audio - + Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved. - + avs2wav - Avisynth to Wave Audio converter - + By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>. - + dcaenc - + Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL. - + MediaInfo - Media File Analysis Tool - + SoX - Sound eXchange - + GnuPG - The GNU Privacy Guard - + GNU Wget - Software for retrieving files using HTTP - + UPX - The Ultimate Packer for eXecutables - + Silk Icons - Over 700 icons in PNG format - + By Mark James, released under the Creative Commons 'by' License. - + The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors. - + n/a @@ -685,44 +685,44 @@ CueSheetModel - + No. - + File / Track - + Index - + Duration - + File %1 - + Track %1 - - + + Unknown Artist - - + + Unknown Title @@ -832,12 +832,12 @@ - + Log File - + The log file shows detailed information about the selected job. @@ -872,7 +872,7 @@ - + Show Details @@ -1615,9 +1615,9 @@ - - - + + + Check for Updates @@ -1658,13 +1658,13 @@ - + Disable Update Reminder - + Disable Sound Effects @@ -1749,839 +1749,839 @@ - + Adding file(s), please wait... - - + + Access Denied - + %n file(s) have been rejected, because read access was not granted! - + This usually means the file is locked by another process. - + CDDA Files - + %n file(s) have been rejected, because they are dummy CDDA files! - + Sorry, LameXP cannot extract audio tracks from an Audio-CD at present. - + We recommend using %1 for that purpose. - + Cue Sheet - + %n file(s) have been rejected, because they appear to be Cue Sheet images! - + Please use LameXP's Cue Sheet wizard for importing Cue Sheet files. - + Files Rejected - + %n file(s) have been rejected, because the file format could not be recognized! - + This usually means the file is damaged or the file format is not supported. - + Scanning folder(s) for files, please wait... - + DEMO VERSION - + Initializing directory outline, please be patient... - + You can drop in audio files here! - + Open File in External Application - + Browse File Location - + Browse Selected Folder - + Refresh Directory Outline - + Go To Parent Directory - + Bookmark Current Output Folder - + Export Meta Tags to CSV File - + Import Meta Tags from CSV File - + License Declined - + You have declined the license. Consequently the application will exit now! - + Goodbye! - + LameXP - Expired - + This demo (pre-release) version of LameXP has expired at %1. - + LameXP is free software and release versions won't expire. - - + + Exit Program - + It seems that a bogus anti-virus software is slowing down the startup of LameXP. - + Please refer to the %1 document for details and solutions! - + Slow Startup - - - - - + + + + + Discard - - + + Don't Show Again - + Urgent Update - + Your version of LameXP is more than a year old. Time for an update! - - + + Ignore - + Skipping update check this time, please be patient... - - - + + + Update Reminder - + Your last update check was more than 14 days ago. Check for updates now? - + Your did not check for LameXP updates yet. Check for updates now? - + Postpone - + LameXP detected that your version of the Nero AAC encoder is outdated! - + The current version available is %1 (or later), but you still have version %2 installed. - + n/a - + You can download the latest version of the Nero AAC encoder from the Nero website at: - + (Hint: Please ignore the name of the downloaded ZIP file and check the included 'changelog.txt' instead!) - + AAC Encoder Outdated - + The Nero AAC encoder could not be found. AAC encoding support will be disabled. - + Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory! - + Your LameXP directory is located here: - + You can download the Nero AAC encoder for free from the official Nero website at: - + AAC Support Disabled - - - + + + LameXP - + You must add at least one file to the list before proceeding! - + Not Found - + Your currently selected TEMP folder does not exist anymore: - + Restore Default - + Cancel - + There are less than %1 GB of free diskspace available on your system's TEMP folder. - + It is highly recommend to free up more diskspace before proceeding with the encode! - + Your TEMP folder is located at: - + Low Diskspace Warning - + Abort Encoding Process - + Clean Disk Now - + Low Diskspace - + You are proceeding with low diskspace. Problems might occur! - + Sorry, an unsupported encoder has been chosen! - + Cannot write to the selected output directory. - + Please choose a different directory! - + Load Translation - + Translation Files - + Do you really want to disable the update reminder? - - - - - - - + + + + + + + Yes - - - - - - - + + + + + + + No - + The update reminder has been disabled. - + Please remember to check for updates at regular intervals! - + The update reminder has been re-enabled. - + Do you really want to disable all sound effects? - - + + Sound Effects - + All sound effects have been disabled. - + The sound effects have been re-enabled. - - - + + + Nero AAC Notifications - + Do you really want to disable all Nero AAC Encoder notifications? - + All Nero AAC Encoder notifications have been disabled. - + The Nero AAC Encoder notifications have been re-enabled. - - - + + + Slow Startup Notifications - + Do you really want to disable the slow startup notifications? - + The slow startup notifications have been disabled. - + The slow startup notifications have been re-enabled. - - + + Open Cue Sheet - - + + Cue Sheet File + + - - Beta Updates - + Do you really want LameXP to check for Beta (pre-release) updates? - + LameXP will check for Beta (pre-release) updates from now on. - + Check Now - + LameXP will <i>not</i> check for Beta (pre-release) updates from now on. - - - + + + Hibernate Computer - + Do you really want the computer to be hibernated on shutdown? - + LameXP will hibernate the computer on shutdown from now on. - + LameXP will <i>not</i> hibernate the computer on shutdown from now on. - - - + + + Shell Integration - + Do you really want to disable the LameXP shell integration? - + The LameXP shell integration has been disabled. - + The LameXP shell integration has been re-enabled. - - + + Add file(s) - - + + Add Folder - - + + Save CSV file - - - - + + + + CSV File - - - - + + + + CSV Export - + Sorry, there are no meta tags that can be exported! - + Sorry, failed to open CSV file for writing! - + Sorry, failed to write to the CSV file! - + The CSV files was created successfully! - - + + Open CSV file - - - - - + + + + + CSV Import - + Sorry, failed to open CSV file for reading! - + Sorry, failed to read from the CSV file! - + Sorry, the CSV file does not contain any known fields! - + CSV file is incomplete. Not all files were updated! - + The CSV files was imported successfully! - - + + New Folder - + Enter the name of the new folder: - + Failed to create folder - + The new folder could not be created: - + Drive is read-only or insufficient access rights! - + Current Encoder: %1 - + Quality Level %1 - + Compression %1 - + Uncompressed - + Best Quality (Slow) - + High Quality (Recommended) - + Acceptable Quality (Fast) - + Poor Quality (Very Fast) - + File name without extension - + Track number with leading zero - + Track title - + Artist name - + Album name - + Year with (at least) four digits - + Comment - + Characters forbidden in file names: - + Rename Macros - + %n Instance(s) - + Cannot write to the selected directory. Please choose another directory! - + Overwrite Mode - + Warning: This mode may overwrite existing files with no way to revert! - + Continue - + Revert - + Already Running - + LameXP is already running, please use the running instance! @@ -3062,209 +3062,209 @@ - + Show details for selected job - + Browse Output File Location - + Filter Log Items - + Show Running Only - + Show Succeeded Only - + Show Failed Only - + Show Skipped Only - + Show All Items - + Encoding Files - + Your files are being encoded, please be patient... - + Encoding files, please wait... - + Multi-threading enabled: Running %1 instances in parallel! - + Aborted! Waiting for running jobs to terminate... - + Encoding: %n file(s) of %1 completed so far, please wait... - + Creating the playlist file, please wait... - + Process was aborted by the user after %n file(s)! - + Process was aborted prematurely by the user! - + LameXP - Aborted - + Process was aborted by the user. - + Process finished after %1. - + Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information! - + %n file(s) skipped - + Error: %1 of %n file(s) failed. Double-click failed items for detailed information! - + LameXP - Error - + At least one file has failed! - + All files completed successfully. Skipped %n file(s). - - + + All files completed successfully. - + LameXP - Done - + None of the items matches the current filtering rules - + Playlist creation failed - + The playlist file could not be created: - + Warning: Computer will shutdown in %1 seconds... - - + + Cancel Shutdown - + %n hour(s) - - + + %n minute(s) - - + + %n second(s) - + %n millisecond(s) @@ -3287,23 +3287,23 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. - + Executable '%1' requires Qt v%2, but found Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. - - + + Executable '%1' requires Windows 2000 or later. @@ -3372,105 +3372,105 @@ - - + + Build - + Unknown - + Testing your internet connection, please wait... - - + + It appears that the computer currently is offline! - - + + Please make sure your computer is connected to the internet and try again. - + Network connectivity test has failed! - + Please make sure your internet connection is working properly and try again. - + Checking for new updates online, please wait... - + Failed to fetch update information from server! - + Sorry, the update server might be busy at this time. Plase try again later. - + More information available at: - + A new version of LameXP is available! - + We highly recommend all users to install this update as soon as possible. - + No new updates available at this time. - + Your version of LameXP is still up-to-date. Please check for updates regularly! - + Your version appears to be newer than the latest release. - + This usually indicates your are currently using a pre-release version of LameXP. - + Update is being downloaded, please be patient... - + Update ready to install. Applicaion will quit... - + Update failed. Please try again or download manually! diff --git a/etc/Translation/LameXP_EN.ts b/etc/Translation/LameXP_EN.ts index d5fa18ac..b6124a6f 100644 --- a/etc/Translation/LameXP_EN.ts +++ b/etc/Translation/LameXP_EN.ts @@ -31,7 +31,7 @@ MainWindow - + %n file(s) have been rejected, because read access was not granted! %n file have been rejected, because read access was not granted! @@ -39,7 +39,7 @@ - + %n file(s) have been rejected, because they are dummy CDDA files! %n file have been rejected, because they are dummy CDDA files! @@ -47,7 +47,7 @@ - + %n file(s) have been rejected, because they appear to be Cue Sheet images! %n file have been rejected, because they appear to be Cue Sheet images! @@ -55,7 +55,7 @@ - + %n file(s) have been rejected, because the file format could not be recognized! %n file have been rejected, because the file format could not be recognized! @@ -63,7 +63,7 @@ - + %n Instance(s) %n Instance @@ -74,7 +74,7 @@ ProcessingDialog - + Encoding: %n file(s) of %1 completed so far, please wait... Encoding: %n file of %1 completed so far, please wait... @@ -82,7 +82,7 @@ - + Process was aborted by the user after %n file(s)! Process was aborted by the user after %n file! @@ -90,7 +90,7 @@ - + Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information! Error: %1 of %n file failed (%2). Double-click failed items for detailed information! @@ -98,7 +98,7 @@ - + %n file(s) skipped %n file skipped @@ -106,7 +106,7 @@ - + Error: %1 of %n file(s) failed. Double-click failed items for detailed information! Error: %1 of %n file failed. Double-click failed items for detailed information! @@ -114,7 +114,7 @@ - + All files completed successfully. Skipped %n file(s). All files completed successfully. Skipped %n file. @@ -122,7 +122,7 @@ - + %n hour(s) %n hour @@ -130,8 +130,8 @@ - - + + %n minute(s) %n minute @@ -139,8 +139,8 @@ - - + + %n second(s) %n second @@ -148,7 +148,7 @@ - + %n millisecond(s) %n millisecond diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index 1d028ea3..442c4b24 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -4,23 +4,23 @@ AboutDialog - + LameXP - Audio Encoder Front-end LameXP - Program do kompresji dźwięku - + Please visit %1 for news and updates! Odwiedź %1 aby zobaczyć nowości i aktualizacje! - - + + Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left. Uwaga: To jest wersja próbna LameXP, która wygaśnie %1. Pozostało jeszcze %2 dni. - + Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!! Uwaga: LameXP jest darmowym oprogramowaniem. <b>Nie</b> płać nikomu za ten program! Jeśli ktoś oferuje Ci LameXP za pieniądze <b>nie</b> kupuj od niego!!! @@ -75,303 +75,303 @@ Zamknij - + The following people have contributed to LameXP: Osoby które pomogły w rozwoju LameXP: - + Programmers: Programiści: - + Project Leader Lider projektu - + Translators: Tłumacze: - + Special thanks to: Specjalne podziękowania dla: - + Doom9's Forum Forum Doom9 - + Gleitz | German Doom9 Gleitz | Niemieckiego Doom9 - + Hydrogenaudio Forums Forum Hydrogenaudio - + RareWares RareWares - + GitHub GitHub - + SourceForge SourceForge - + Qt Developer Network Qt Developer Network - + Marius Hudea Marius Hudea - + Codecs.com Codecs.com - + If you are willing to contribute a LameXP translation, feel free to contact us! Jeśli chcesz wspomóc LameXP w obsłudze większej ilości języków, nie wahaj skontaktować się z nami! - + The following third-party software is used in LameXP: Następujące programy firm trzecich zostały użyte w LameXP: - + LAME - OpenSource mp3 Encoder LAME - Otwartoźródłowy koder mp3 - - - - - - - - - - - - + + + + + + + + + + + + Released under the terms of the GNU Lesser General Public License. Wydane na warunkach licencji GNU Lesser General Public License. - + OggEnc - Ogg Vorbis Encoder OggEnc - Koder Ogg Vorbis - + Completely open and patent-free audio encoding technology. Całkowicie otwarta i wolna od patentów technologia kompresji dźwięku. - + Nero AAC Reference MPEG-4 Encoder Nero AAC Reference MPEG-4 Encoder - + Freeware state-of-the-art HE-AAC encoder with 2-Pass support. Darmowy, jedyny w swoim rodzaju koder HE-AAC z wsparciem dla dwóch przebiegów. - + Available from vendor web-site as free download: Darmowy pakiet dostępny ze strony wydawcy: - + Aften - A/52 audio encoder Aften - Koder dźwięku A/52 - + FLAC - Free Lossless Audio Codec FLAC - Darmowy i bezstartny kodek dźwięku - + Open and patent-free lossless audio compression technology. Otwarta i wolna od patentów technologia bezstratnej kompresji dźwięku. - + Opus Audio Codec Opus Audio Codec - + Totally open, royalty-free, highly versatile audio codec. Otwartoźródłowy, wolny od patentów, wielozadaniowy kodek dźwięku. - + mpg123 - Fast Console MPEG Audio Player/Decoder mpg123 - Szybki dekoder/odtwarzacz MPEG Audio - + FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder FAAD - Otwartoźródłowy dekoder MPEG-4 oraz MPEG-2 AAC - + Released under the terms of the GNU General Public License. Wydane na warunkach licencji GNU General Public License. - + Valdec from AC3Filter Tools - AC3/DTS Decoder Dekoder AC3/DTS z narzędzi AC3Filter Tools Valdec'a - + WavPack - Hybrid Lossless Compression Wavpack - Bezstratny hybrydowy kodek dźwięku - + Completely open audio compression format. Całkowicie otwarty format kompresji dźwięku. - + Musepack - Living Audio Compression Musepack - Koder dźwięku - + Monkey's Audio - Lossless Audio Compressor Monkey's Audio - Koder bezstratnego formatu dźwięku - + Freely available source code, simple SDK and non-restrictive licensing. Szeroko dostępny kod źródłowy, prosty SDK i bezrestrykcyjna licencja. - + Shorten - Lossless Audio Compressor Shorten - Bezstratny kodek dźwięku - + Speex - Free Codec For Free Speech Speex - Darmowy kodek dla mowy ludzkiej - + Open Source patent-free audio format designed for speech. Otwartoźródłowy, wolny od patentów format dźwięku przeznaczony dla mowy ludzkiej. - + The True Audio - Lossless Audio Codec The True Audio - Bezstratny kodek dźwięku - + refalac - Win32 command line ALAC encoder/decoder refalac - Koder/dekoder ALAC na platformę Win32 działający z wiersza poleceń - + The ALAC reference implementation by Apple is available under the Apache license. Referencyjna implementacja formatu ALAC firmy Apple jest dostępna na licencji Apache. - + wma2wav - Dump WMA files to Wave Audio wma2wav - Dekoder plików WMA do Wave - + Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved. Prawa autorskie 2011 LoRd_MuldeR <mulder2@gmx.de>. Pewne prawa zastrzeżone. - + avs2wav - Avisynth to Wave Audio converter avs2wav - Konwerter dźwięku z Avisynth do Wave - + By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>. Autorami programu są Jory Stone <jcsston@toughguy.net> i LoRd_MuldeR <mulder2@gmx.de>. - + dcaenc dcaenc - + Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL. Prawa autorskie: 2008-2011 Alexander E. Patrakov. Rozpowszechniane na licencji LGPL. - + MediaInfo - Media File Analysis Tool MediaInfo - Narzędzie do analizy plików multimedialnych - + SoX - Sound eXchange SoX - Sound eXchange - + GnuPG - The GNU Privacy Guard GnuPG - GNU Privacy Guard - + GNU Wget - Software for retrieving files using HTTP GNU Wget - Oprogramowanie służące do pobierania plików za pomocą protokołu HTTP - + UPX - The Ultimate Packer for eXecutables UPX - The Ultimate Packer for eXecutables - + Silk Icons - Over 700 icons in PNG format Silk Icons - Ponad 700 ikon w formacie PNG - + By Mark James, released under the Creative Commons 'by' License. Autorstwa Mark James, wydane na licencji Creative Commons. - + The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors. Do programu LameXP jako całości, prawa autorskie posiada LoRd_MuldeR. Prawa autorskie oprogramowania firm trzecich należą do autorów poszczególnych programów. - + n/a n/d @@ -691,44 +691,44 @@ CueSheetModel - + No. Numer. - + File / Track Plik/ŚcieżKa - + Index Indeks - + Duration Czas trwania - + File %1 Plik %1 - + Track %1 Ścieżka %1 - - + + Unknown Artist Nieznany Artysta - - + + Unknown Title Nieznany Tytuł @@ -838,12 +838,12 @@ Kopiuj do schowka - + Log File Plik dziennika zdarzeń - + The log file shows detailed information about the selected job. Plik dziennika zdarzeń pokazuje szczegółowe informacje na temat wybranego zadania. @@ -878,7 +878,7 @@ - + Show Details Pokaż szczegóły @@ -1622,9 +1622,9 @@ - - - + + + Check for Updates Sprawdź aktualizacje @@ -1665,13 +1665,13 @@ - + Disable Update Reminder Wyłącz przypominanie o aktualizacji - + Disable Sound Effects Wyłącz efekty dźwiękowe @@ -1756,314 +1756,314 @@ Otwartoźródłowe projekty MuldeR'a - + Adding file(s), please wait... Dodawanie plików, prosze czekać... - - + + Access Denied Dostęp zablokowany - + This usually means the file is locked by another process. To przeważnie oznacza, że plik jest zablokowany przez inny proces. - + CDDA Files Pliki CDDA - + Sorry, LameXP cannot extract audio tracks from an Audio-CD at present. LameXP nie może teraz wyekstrachować ścieżki z płyty Audio-CD. - + We recommend using %1 for that purpose. Zaleca się użycie w tym celu %1. - + Cue Sheet Cue Sheet - + Please use LameXP's Cue Sheet wizard for importing Cue Sheet files. Prosze użyć przewodnika Cue Sheet w LameXP w celu importowania tych plików. - + Files Rejected Pliki odrzucone - + This usually means the file is damaged or the file format is not supported. To przeważnie oznacza że plik jest uszkodzony lub format pliku nie jest wspierany. - + Scanning folder(s) for files, please wait... Skanowanie folderu/ów, prosze czekać... - + You can drop in audio files here! Tutaj możesz upuścić pliki dźwiękowe! - + Open File in External Application Otwórz plik w zewnętrznym programie - + Browse File Location Otwórz lokalizację pliku - + Browse Selected Folder Otwórz wybrany folder - + Bookmark Current Output Folder Zapamiętaj wybrany folder - + License Declined Licencja odrzucona - + You have declined the license. Consequently the application will exit now! Odrzuciłeś licencję. W takim razie program zostanie teraz zamknięty! - + Goodbye! Naraska! - + LameXP - Expired LameXP - Termin wygasł - + This demo (pre-release) version of LameXP has expired at %1. Ta wersja próbna LameXP wygasła %1. - + LameXP is free software and release versions won't expire. LameXP jest darmowym oprogramowaniem i pełna wersja nie wygasa. - - + + Exit Program Wyjdź z programu - + It seems that a bogus anti-virus software is slowing down the startup of LameXP. Najwyraźniej twoje oprogramowanie antywirusowe spowalnia uruchamianie się LameXP. - + Please refer to the %1 document for details and solutions! Prosze sprawdzić dokument %1 w celu dalszych szcegółów i rozwiązań! - + Slow Startup Powolny start - - - - - + + + + + Discard Zamknij - - + + Don't Show Again Nie pokazuj ponownie - + Urgent Update Ważna aktualizacja - + Your version of LameXP is more than a year old. Time for an update! Twoja wersja LameXP jest starsza niż rok! Czas na aktualizację! - - - + + + Update Reminder Powiadomienie aktualizacji - + Your last update check was more than 14 days ago. Check for updates now? Ostatnie sprawdzenie aktualizacji było ponad 14 dni temu. Sprawdzić teraz aktualizacje? - + Your did not check for LameXP updates yet. Check for updates now? Nie sprawdzałeś jeszcze aktualizacji LameXP. Sprawdzić teraz aktualizacje? - + Postpone Przełóż - + LameXP detected that your version of the Nero AAC encoder is outdated! LameXP wykrył że Twoja wersja kodera Nero AAC jest nieaktualna! - + The current version available is %1 (or later), but you still have version %2 installed. Wersją dostępną obecnie jest %1, Twoja wersja to %2. - + n/a b/d - + You can download the latest version of the Nero AAC encoder from the Nero website at: Możesz pobrać najnowszą wersję kodera Nero AAC ze strony Nero: - + AAC Encoder Outdated Koder AAC jest nieaktualny - + The Nero AAC encoder could not be found. AAC encoding support will be disabled. Nie można odnaleźć kodera Nero AAC. Kompresja formatu AAC zostanie wyłączona. - + Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory! Prosze skopiować 'neroAacEnc.exe', 'neroAacDec.exe', oraz 'neroAacTag.exe' do folderu LameXP! - + Your LameXP directory is located here: Folder aplikacji LameXP znajduje się tutaj: - + You can download the Nero AAC encoder for free from the official Nero website at: Możesz pobrać koder Nero AAC za darmo z oficjalnej strony Nero: - + AAC Support Disabled Wsparcie dla AAC wyłączone - - - + + + LameXP LameXP - + You must add at least one file to the list before proceeding! Powinienieś dodać przynajmniej jeden plik do listy aby zacząć działać! - + Not Found Nie znaleziono - + Your currently selected TEMP folder does not exist anymore: Wybrany przez Ciebie folder tymczasowy TEMP już nie istnieje: - + Restore Default Przywróć domyślne - + Cancel Anuluj - + Low Diskspace Warning Ostrzeżenie o małej ilości miejsca na dysku - + There are less than %1 GB of free diskspace available on your system's TEMP folder. Jest mniej niż %1 GB dostępnego miejsca w systemowym folderze TEMP. - + DEMO VERSION WERSJA PRÓBNA - + (Hint: Please ignore the name of the downloaded ZIP file and check the included 'changelog.txt' instead!) (Podpowiedź: Zignoruj nazwę pobranego pliku ZIP, w zamian sprawdż załączony w archiwum plik "changelog.txt"!) - + It is highly recommend to free up more diskspace before proceeding with the encode! Jest wysoce zalecane zwolnić miejsce na dysku zanim zaczniesz kompresję! - + Your TEMP folder is located at: Twój folder TEMP znajduję się: - + Abort Encoding Process Przerwij proces kompresji - + Clean Disk Now Wykonaj oczyszczanie dysku - - + + Ignore Ignoruj - + %n file(s) have been rejected, because read access was not granted! %n plik został odrzucony, ponieważ nie dano praw odczytu! @@ -2072,7 +2072,7 @@ - + %n file(s) have been rejected, because they are dummy CDDA files! %n plik został odrzucony, ponieważ jest to plik CDDA! @@ -2081,7 +2081,7 @@ - + %n file(s) have been rejected, because they appear to be Cue Sheet images! %n plik został odrzucony, ponieważ jest to plik Cue! @@ -2090,7 +2090,7 @@ - + %n file(s) have been rejected, because the file format could not be recognized! %n plik został odrzucony, ponieważ jego format nie został rozpoznany! @@ -2099,467 +2099,467 @@ - + Initializing directory outline, please be patient... Ładowanie zestawu folderów, prosze czekać... - + Refresh Directory Outline Odśwież foldery - + Go To Parent Directory Idź do głównego folderu - + Export Meta Tags to CSV File Eksportuj Tagi do pliku CVS - + Import Meta Tags from CSV File Importuj Tagi do pliku CVS - + Skipping update check this time, please be patient... Pomijanie sprawdzania aktualizacji, prosze czekać... - + Low Diskspace Mało miejsca na dysku - + You are proceeding with low diskspace. Problems might occur! Chcesz zacząć działać z małą ilością miejsca na dysku. Mogą wystąpić problemy! - + Sorry, an unsupported encoder has been chosen! Został wybrany koder, który nie jest wspierany! - + Cannot write to the selected output directory. Nie można zapisać do wybranej lokalizacji. - + Please choose a different directory! Prosze wybrać inną lokalizację! - + Load Translation Zaladuj plik językowy - + Translation Files Pliki językowe - + Do you really want to disable the update reminder? Czy na pewno chcesz wyłączyć przypominanie o aktualizacjach? - - - - - - - + + + + + + + Yes Tak - - - - - - - + + + + + + + No Nie - + The update reminder has been disabled. Przypominanie o aktualizacjach wyłączone. - + Please remember to check for updates at regular intervals! Prosze pamiętać o okresowym sprawdzaniu aktualizacji! - + The update reminder has been re-enabled. Przypominanie o aktualizacjach ponownie włączone. - + Do you really want to disable all sound effects? Czy na pewno chcesz wyłączyć wszystkie dźwiękowe? - - + + Sound Effects Efekty dźwiękowe - + All sound effects have been disabled. Wszystkie efekty dźwiękowe zostały wyłączone. - + The sound effects have been re-enabled. Efekty dźwiękowe zostały ponownie włączone. - - - + + + Nero AAC Notifications Powiadomienia Nero AAC - + Do you really want to disable all Nero AAC Encoder notifications? Czy na pewno chcesz wyłączyć wszystkie powiadomienia Nero AAC? - + All Nero AAC Encoder notifications have been disabled. Wszystkie powiadomienia kodera Nero AAC zostały wyłączone. - + The Nero AAC Encoder notifications have been re-enabled. Powiadomienia Nero AAC zostały ponownie włączone. - - - + + + Slow Startup Notifications Powiadomienia o powolnym starcie - + Do you really want to disable the slow startup notifications? Czy na pewno chcesz wyłączyć powiadomienia o powolnym starcie? - + The slow startup notifications have been disabled. Powiadomienia o powolnym starcie zostały wyłączone. - + The slow startup notifications have been re-enabled. Powiadomienia o powolnym starcie zostały ponownie włączone. - - + + Open Cue Sheet Otwórz plik Cue Sheet - - + + Cue Sheet File Plik Cue Sheet + + - - Beta Updates Aktualizacje Beta - + Do you really want LameXP to check for Beta (pre-release) updates? Czy na pewno chcesz aby LameXP sprawdzał aktualizacje Beta? - + LameXP will check for Beta (pre-release) updates from now on. Od teraz LameXP będzie sprawdzał aktualizacje Beta. - + Check Now Sprawdź teraz - + LameXP will <i>not</i> check for Beta (pre-release) updates from now on. LameXP od teraz <i>nie będzie</i> sprawdzał aktualizacji Beta. - - - + + + Hibernate Computer Hibernuj komputer - + Do you really want the computer to be hibernated on shutdown? Czy na pewno chcesz aby komputer był hibernowany zamiast zamykany? - + LameXP will hibernate the computer on shutdown from now on. Od teraz LameXP będzie hibernował komputer zamiast zamykać. - + LameXP will <i>not</i> hibernate the computer on shutdown from now on. LameXP od teraz <i>nie</i> będzie hibernował komputera tylko zamykał. - - - + + + Shell Integration Integracja z systemem - + Do you really want to disable the LameXP shell integration? Czy na pewno chcesz wyłączyć integrację LameXP z systemem? - + The LameXP shell integration has been disabled. Integracja LameXP z systemem zostałą wyłączona. - + The LameXP shell integration has been re-enabled. Integracja LameXP z systemem została ponownie włączona. - - + + Add file(s) Dodaj plik(i) - - + + Add Folder Dodaj folder - - + + Save CSV file Zapisz plik CSV - - - - + + + + CSV File Plik CSV - - - - + + + + CSV Export Eksportowanie CSV - + Sorry, there are no meta tags that can be exported! Nie ma żadnych tagów, które można eksportować! - + Sorry, failed to open CSV file for writing! Nie można otworzyć pliku CSV aby go zapisać! - + Sorry, failed to write to the CSV file! Nie można zapisać do pliku CSV! - + The CSV files was created successfully! Pliki CSV utworzone pomyślnie! - - + + Open CSV file Otwórz plik CSV - + Sorry, failed to open CSV file for reading! Nie można otworzyć pliku CSV aby go wczytać! - - - - - + + + + + CSV Import Importowanie CSV - + Sorry, failed to read from the CSV file! Próba odczytania pliku CSV zakończona niepowodzeniem! - + Sorry, the CSV file does not contain any known fields! Plik CSV nie zawiera żadnych znanych pól! - + CSV file is incomplete. Not all files were updated! Plik CSV nie jest kompletny. Nie wszystkie pliki zostały zaktualizowane! - + The CSV files was imported successfully! Pliki CSV zaimportowano pomyślnie! - - + + New Folder Nowy folder - + Enter the name of the new folder: Wprowadź nazwę nowego folderu: - + Failed to create folder Utworzenie folderu zakończone niepowodzeniem - + The new folder could not be created: Nowy folder nie mógł zostać stworzony: - + Drive is read-only or insufficient access rights! Dysk tylko do odczytu lub brak praw dostępu! - + Quality Level %1 Poziom jakości %1 - + Compression %1 Kompresja %1 - + Uncompressed Nieskompresowany - + Best Quality (Slow) Najlepsza jakość (Powoli) - + Acceptable Quality (Fast) Akceptowalna jakość (Szybko) - + High Quality (Recommended) Wysoka jakość (Zalecane) - + Current Encoder: %1 - + Poor Quality (Very Fast) Najniższa jakość (Bardzo szybko) - + File name without extension Nazwa pliku bez rozszerzenia - + Track number with leading zero Numer ścieżki z zerem na początku - + Track title Nazwa ścieżki - + Artist name Nazwa Artysty - + Album name Nazwa Albumu - + Year with (at least) four digits Rok z (przynajmniej) czterema cyframi - + Comment Komentarz - + Characters forbidden in file names: Zabronione znaki w nazwach plików: - + Rename Macros Zmień nazwy makr - + %n Instance(s) %n wątek @@ -2568,37 +2568,37 @@ - + Cannot write to the selected directory. Please choose another directory! Nie można zapisać do wybranej lokalizacji. Prosze wybierz inną lokalizację! - + Overwrite Mode Tryb nadpisywania - + Warning: This mode may overwrite existing files with no way to revert! Ostrzeżenie: W tym trybie istniejące pliki będą nadpisywane bez możliwości ich odzyskania! - + Continue Kontynuuj - + Revert Cofnij - + Already Running Już działa - + LameXP is already running, please use the running instance! LameXP już działa, przejdź do działającego procesu! @@ -3079,72 +3079,72 @@ Powrót - + Show details for selected job Pokaż szczegóły wybranego zadania - + Browse Output File Location Wybierz lokalizację dla plików wyjściowych - + Filter Log Items Filtruj długie pozycje - + Show Running Only Pokaż tylko trwające - + Show Succeeded Only Pokaż tylko zakończone pomyślnie - + Show Failed Only Pokaż tylko zakończone niepowodzeniem - + Show Skipped Only Pokaż tylko pominięte - + Show All Items Pokaż wszystkie pozycje - + Encoding Files Kompresowanie plików - + Your files are being encoded, please be patient... Twoje pliki są właśnie kompresowane, prosze być cierpliwy... - + Encoding files, please wait... Kompresowanie plików, prosze czekać... - + Multi-threading enabled: Running %1 instances in parallel! Wielowątkowosć włączona: Równolegle wykonywanych jest %1 kodowań! - + Aborted! Waiting for running jobs to terminate... Przerwano! Czekanie na wyłączenie procesu... - + Encoding: %n file(s) of %1 completed so far, please wait... Kompresowanie: %n plik z %1 został do tej pory zakończony, prosze czekać... @@ -3153,17 +3153,17 @@ - + Creating the playlist file, please wait... Tworzenie pliku playlisty, prosze czekać... - + Process was aborted prematurely by the user! Proces został przedwcześnie zakończony przez użytkownika! - + Process was aborted by the user after %n file(s)! Proces został zakończony przez użytkownika po zakończeniu %n pliku! @@ -3172,22 +3172,22 @@ - + LameXP - Aborted LameXP - Przerwano - + Process was aborted by the user. Proces został przerwany przez użytkownika. - + Process finished after %1. Proces został zakończony po %1. - + Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information! Błąd: %1 z %n pliku zakończono niepowodzeniem (%2). Kliknij dwukrotnie aby uzyskać więcej informacji! @@ -3196,7 +3196,7 @@ - + %n file(s) skipped pominięto %n plik @@ -3205,7 +3205,7 @@ - + Error: %1 of %n file(s) failed. Double-click failed items for detailed information! Błąd: %1 z %n pliku zakończono niepowodzeniem. Kliknij dwukrotnie aby uzyskać więcej informacji! @@ -3214,7 +3214,7 @@ - + All files completed successfully. Skipped %n file(s). Wszystkie zadania wykonano pomyślnie. Pominięto %n plik. @@ -3223,54 +3223,54 @@ - + LameXP - Error LameXP - Błąd - + At least one file has failed! Przynajmniej jeden plik nie został skompresowany! - - + + All files completed successfully. Kompresja wszystkich plików zakończona powodzeniem. - + LameXP - Done LameXP - Zrobione - + None of the items matches the current filtering rules Żadna z pozycji nie spełnia reguł filtra - + Playlist creation failed Tworzenie playlisty zakończone niepowodzeniem - + The playlist file could not be created: Playlista nie mogła zostać utworzona: - + Warning: Computer will shutdown in %1 seconds... Ostrzeżenie: Komputer zostanie zamknięty za %1 sekund/y... - - + + Cancel Shutdown Anuluj wyłączenie komputera - + %n hour(s) %n godzina @@ -3279,8 +3279,8 @@ - - + + %n minute(s) %n minuta @@ -3289,8 +3289,8 @@ - - + + %n second(s) %n sekunda @@ -3299,7 +3299,7 @@ - + %n millisecond(s) %n milisekunda @@ -3324,23 +3324,23 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. Plik wykonywalny '%1' nie działa w trybie kompatybilności z Windows. - + Executable '%1' requires Qt v%2, but found Qt v%3. Plik wykonywalny '%1' wymaga Qt v%2, znaleziono jednak Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. Plik wykonywalny "%1" został skompilowany dla Qt "%2", znaleziono "%3". - - + + Executable '%1' requires Windows 2000 or later. Plik wykonywalny '%1' wymaga do uruchomienia Windows 2000 lub nowszego. @@ -3409,105 +3409,105 @@ Zamknij - - + + Build Build - + Unknown Nieznana - + Testing your internet connection, please wait... Testowanie połączenia internetowego, prosze czekać... - - + + It appears that the computer currently is offline! LameXP wykrył brak dostępu do internetu! - - + + Please make sure your computer is connected to the internet and try again. Upewnij się że komputer jest podłączony do internetu i spróbuj ponownie. - + Network connectivity test has failed! Test połączenia internetowego zakończony niepowodzeniem! - + Please make sure your internet connection is working properly and try again. Upewnij się że połączenie internetowe działa prawidłowo i spróbuj ponownie. - + Checking for new updates online, please wait... Sprawdzanie aktualizacji online, prosze czekać... - + Failed to fetch update information from server! Pobieranie informacji z serwera zakończone niepowodzeniem! - + Sorry, the update server might be busy at this time. Plase try again later. Serwer aktualizacji wydaje się nie odpowiadać w tej chwili. Prosze spróbować później. - + More information available at: Więcej informacji tutaj: - + A new version of LameXP is available! Dostępna nowa wersja LameXP! - + We highly recommend all users to install this update as soon as possible. Jest wysoce zalecane aby zainstalować tę aktualizację jak najszybciej. - + No new updates available at this time. Nie ma nowych aktualizacji w tej chwili. - + Your version of LameXP is still up-to-date. Please check for updates regularly! Posiadasz najnowszą wersję LameXP. Sprawdzaj aktualizacje regularnie! - + Your version appears to be newer than the latest release. Posiadasz nowszą wersję LameXP niż ostatnie wydanie. - + This usually indicates your are currently using a pre-release version of LameXP. To wskazuje na to, że posiadasz wersję alfa LameXP. - + Update is being downloaded, please be patient... Pobieranie aktualizacji w toku, prosze czekać... - + Update ready to install. Applicaion will quit... Aktualizacja gotowa do instalacji. Teraz program zostanie zamknięty... - + Update failed. Please try again or download manually! Aktualizacja zakończona niepowodzeniem. Prosze spróbować ponownie lub zainstalować ręcznie! diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index 0c6414ea..8049e3cd 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -4,23 +4,23 @@ AboutDialog - + LameXP - Audio Encoder Front-end LameXP - Ljudkonvertering - + Please visit %1 for news and updates! Besök %1 för nyheter och uppdateringar! - - + + Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left. OBS! Denna testversion av LameXP kommer att upphöra %1. %2 dagar kvar. - + Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!! OBS! LameXP är gratis mjukvara. Betala <b>inte</b> för att ladda ner eller använda LameXP! Om någon webbsida försöker ta betalt för LameXP, bör du lämna sidan <b>utan</b> att ladda ner något! @@ -75,303 +75,303 @@ Stäng - + The following people have contributed to LameXP: Följande har medverkat i LameXP: - + Programmers: Programmerare: - + Project Leader Projektledare - + Translators: Översättare: - + Special thanks to: Speciellt tack till: - + Doom9's Forum Doom9's Forum - + Gleitz | German Doom9 Gleitz | German Doom9 - + Hydrogenaudio Forums Hydrogenaudio Forums - + RareWares RareWares - + GitHub GitHub - + SourceForge SourceForge - + Qt Developer Network Qt Developer Network - + Marius Hudea Marius Hudea - + Codecs.com Codecs.com - + If you are willing to contribute a LameXP translation, feel free to contact us! Kontakta oss gärna om du vill medverka il LameXP, med en översättning! - + The following third-party software is used in LameXP: Följande 3:e-parts mjukvara används i LameXP: - + LAME - OpenSource mp3 Encoder LAME - OpenSource mp3 Encoder - - - - - - - - - - - - + + + + + + + + + + + + Released under the terms of the GNU Lesser General Public License. Släppt under Gnu Lesser General Public License. - + OggEnc - Ogg Vorbis Encoder OggEnc - Ogg Vorbis Encoder - + Completely open and patent-free audio encoding technology. Helt öppen och patentfri ljudkodningsteknologi. - + Nero AAC Reference MPEG-4 Encoder Nero AAC Reference MPEG-4 Encoder - + Freeware state-of-the-art HE-AAC encoder with 2-Pass support. Freeware state-of-the-art HE-AAC-kodare med stöd för 2-Pass. - + Available from vendor web-site as free download: Tillgänglig som gratis nedladdning, från utvecklarens webbsida: - + Aften - A/52 audio encoder Aften - A/52 audio encoder - + FLAC - Free Lossless Audio Codec FLAC - Free Lossless Audio Codec - + Open and patent-free lossless audio compression technology. Öppen och patentfri, förlustfri ljudkomprimeringsteknik. - + Opus Audio Codec Opus Audio Codec - + Totally open, royalty-free, highly versatile audio codec. Helt öppen, avgiftsfri, mycket mångsidig ljud-codec - + mpg123 - Fast Console MPEG Audio Player/Decoder mpg123 - Fast Console MPEG Audio Player/Decoder - + FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder - + Released under the terms of the GNU General Public License. Släppt under GNU Generel Public License (GPL). - + Valdec from AC3Filter Tools - AC3/DTS Decoder Valdec från AC3Filter Tools - AC3/DTS Decoder - + WavPack - Hybrid Lossless Compression WavPack - Hybrid Lossless Compression - + Completely open audio compression format. Helt öppet ljudkomprimeringsformat. - + Musepack - Living Audio Compression Musepack - Living Audio Compression - + Monkey's Audio - Lossless Audio Compressor Monkey's Audio - Lossless Audio Compressor - + Freely available source code, simple SDK and non-restrictive licensing. Fritt tillgänglig källkod, enkel SDK och icke-restriktiv licensiering. - + Shorten - Lossless Audio Compressor Shorten - Lossless Audio Compressor - + Speex - Free Codec For Free Speech Speex - Free Codec For Free Speech - + Open Source patent-free audio format designed for speech. Öppen källkod, patentfritt ljudformat designat för tal. - + The True Audio - Lossless Audio Codec The True Audio - Lossless Audio Codec - + refalac - Win32 command line ALAC encoder/decoder refalac - Win32 kommandorad ALAC-kodare/-avkodare - + The ALAC reference implementation by Apple is available under the Apache license. ALAC referensimplementation av Apple finns tillgänglig under Apache-licensen. - + wma2wav - Dump WMA files to Wave Audio wma2wav - Dump WMA files to Wave Audio - + Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved. Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved. - + avs2wav - Avisynth to Wave Audio converter avs2wav - Avisynth to Wave Audio converter - + By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>. By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>. - + dcaenc dcaenc - + Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL. Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL. - + MediaInfo - Media File Analysis Tool MediaInfo - Analysverktyg för mediafiler - + SoX - Sound eXchange SoX - Sound eXchange - + GnuPG - The GNU Privacy Guard GnuPG - The GNU Privacy Guard - + GNU Wget - Software for retrieving files using HTTP GNU Wget - Mjukvara för att ta emot filer via HTTP - + UPX - The Ultimate Packer for eXecutables UPX - Den ultimata paketeraren för exekverbara filer - + Silk Icons - Over 700 icons in PNG format Silk Icons - Över 700 iconer i PNG-format - + By Mark James, released under the Creative Commons 'by' License. Av Mark James, publicerad under Creative Commons 'by' Licens. - + The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors. The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors. - + n/a n/a @@ -689,44 +689,44 @@ CueSheetModel - + No. Nr. - + File / Track Fil / Spår - + Index Index - + Duration Varaktighet - + File %1 Fil %1 - + Track %1 Spår %1 - - + + Unknown Artist Okänd artist - - + + Unknown Title Okänd titel @@ -836,12 +836,12 @@ Kopiera till Urklipp - + Log File Loggfil - + The log file shows detailed information about the selected job. Loggfilen visar detaljerad information om markerad aktivitet. @@ -876,7 +876,7 @@ - + Show Details Visa detaljer @@ -1619,9 +1619,9 @@ - - - + + + Check for Updates Sök efter uppdateringar @@ -1662,13 +1662,13 @@ - + Disable Update Reminder Inaktivera uppdateringsmeddelande - + Disable Sound Effects Inaktivera ljudeffekter @@ -1753,23 +1753,23 @@ MuldeRs Öppen källkodsprojekt - + Adding file(s), please wait... Lägger till fil(er), vänta... - - + + Access Denied Åtkomst nekad - + This usually means the file is locked by another process. Det innebär oftast att filen är låst av någon annan process. - + %n file(s) have been rejected, because read access was not granted! %n fil har avvisats, eftersom läsbehörighet saknas! @@ -1777,22 +1777,22 @@ - + CDDA Files CDDA-filer - + Sorry, LameXP cannot extract audio tracks from an Audio-CD at present. LameXP kan för närvarande inte extrahera ljudspår från en ljud-CD. - + We recommend using %1 for that purpose. Vi rekommenderar att du använder %1 för det ändamålet. - + %n file(s) have been rejected, because they are dummy CDDA files! %n fil har avvisats, eftersom det är en CDDA attrappfil (dummy)! @@ -1800,17 +1800,17 @@ - + Cue Sheet Cue-fil - + Please use LameXP's Cue Sheet wizard for importing Cue Sheet files. Använd LameXPs cue-guide för att importera cue-filer. - + %n file(s) have been rejected, because they appear to be Cue Sheet images! %n fil har avvisats, eftersom det verkar vara en cue-avbildning! @@ -1818,17 +1818,17 @@ - + Files Rejected Undantagna filer - + This usually means the file is damaged or the file format is not supported. Det innebär oftast att filen är skadad eller att filformatet inte stöds. - + %n file(s) have been rejected, because the file format could not be recognized! %n fil har avvisats, eftersom filformatet inte känns igen! @@ -1836,723 +1836,723 @@ - + Scanning folder(s) for files, please wait... Genomsöker mapp(ar) efter fil(er), vänta... - + DEMO VERSION DEMOVERSION - + You can drop in audio files here! Du kan dra och släppa filer här! - + Initializing directory outline, please be patient... Initierar mappdisposition, vänta... - + Open File in External Application Öppna fil i externt program - + Browse File Location Öppna målmappen - + Browse Selected Folder Öppna markerad mapp - + Refresh Directory Outline Uppdatera mappdisposition - + Go To Parent Directory Gå till överordnad mapp - + Bookmark Current Output Folder Lägg till aktuell utdatamapp i favoriter - + Export Meta Tags to CSV File Exportera metadata till CSV-fil - + Import Meta Tags from CSV File Importera metadata från CSV-fil - + License Declined Licensavtal avvisat - + You have declined the license. Consequently the application will exit now! Du har nekat att godkänna licensavtalet. Programmet kommer nu att avslutas! - + Goodbye! Hej då! - + LameXP - Expired LameXP - Upphört - + This demo (pre-release) version of LameXP has expired at %1. Denna demoversion av LameXP har upphört att gälla från %1. - + LameXP is free software and release versions won't expire. LameXP är kostnadsfritt och release-versionerna upphör inte att gälla. - - + + Exit Program Avsluta programmet - + It seems that a bogus anti-virus software is slowing down the startup of LameXP. Det verkar som ett antivirusprogram orsakar långsammare uppstart av LameXP. - + Please refer to the %1 document for details and solutions! Läs gärna %1 för detaljer och lösningar! - + Slow Startup Långsam uppstart - - - - - + + + + + Discard Stäng - - + + Don't Show Again Visa inte igen - + Urgent Update Viktig uppdatering - + Your version of LameXP is more than a year old. Time for an update! Din version av LameXP är mer än ett år gammal. Dags att uppdatera! - - + + Ignore Ignorera - + Skipping update check this time, please be patient... Hoppar över uppdateringskontrollen den här gången, vänta... - - - + + + Update Reminder Uppdateringspåminnelse - + Your last update check was more than 14 days ago. Check for updates now? Din senaste uppdateringskontroll var för mer än 14 dagar sedan. Vill du söka efter uppdateringar nu? - + Your did not check for LameXP updates yet. Check for updates now? Du har inte genomfört uppdateringskontroll ännu. Vill du söka efter uppdateringar nu? - + Postpone Skjut upp - + LameXP detected that your version of the Nero AAC encoder is outdated! LameXP har uptäckt att din version av Nero AAC-kodare är utdaterad! - + The current version available is %1 (or later), but you still have version %2 installed. Aktuell version är %1 (eller senare), men du har fortfarande version %2. - + n/a n/a - + You can download the latest version of the Nero AAC encoder from the Nero website at: Du kan ladda ner senaste versionen av Nero AAC-kodare från Neros webbsida: - + (Hint: Please ignore the name of the downloaded ZIP file and check the included 'changelog.txt' instead!) (Tips: Bortse från den nedladde zipfilens namn, och kontrollera istället den inkluderade textfilen 'changelog.txt'!) - + AAC Encoder Outdated AAC-kodare utdaterad - + The Nero AAC encoder could not be found. AAC encoding support will be disabled. Neros AAC-kodare kan inte hittas. Stödet för AAC-kodning kommer att inaktiveras. - + Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory! Placera 'neroAacEnc.exe', 'neroAacDec.exe' och 'neroAacTag.exe' i LameXPs programmmapp! - + Your LameXP directory is located here: Din LameXP programmapp finns här: - + You can download the Nero AAC encoder for free from the official Nero website at: Du kan ladda ner Nero AAC-kodare gratis från den officiella webbsidan: - + AAC Support Disabled AAC-stödet är inaktiverat - - - + + + LameXP LameXP - + You must add at least one file to the list before proceeding! Du måste lägga till minst en fil till listan innan du fortsätter! - + Not Found Kan inte hittas - + Your currently selected TEMP folder does not exist anymore: Din aktuella TEMP-mapp finns inte längre: - + Restore Default Återställ standard - + Cancel Avbryt - + There are less than %1 GB of free diskspace available on your system's TEMP folder. Det finns mindre än %1 GB ledigt diskutrymme i systemets temp-mapp. - + It is highly recommend to free up more diskspace before proceeding with the encode! Du behöver frigöra mer diskutrymme innan du fortsätter med omkodningen! - + Your TEMP folder is located at: Temp-mappens placering: - + Low Diskspace Warning Varning för dåligt diskutrymme - + Abort Encoding Process Avbryt omkodningsprocessen - + Clean Disk Now Rensa disken nu - + Low Diskspace Dåligt diskutrymme - + You are proceeding with low diskspace. Problems might occur! Du fortsätter med dåligt diskutrymme. Problem kan uppstå! - + Sorry, an unsupported encoder has been chosen! En kodare som saknar stöd har valts! - + Cannot write to the selected output directory. Kan inte skriva till den valda utdatamappen. - + Please choose a different directory! Välj en annan målmapp! - + Load Translation Läs in översättning - + Translation Files Översättningsfiler - + Do you really want to disable the update reminder? Vill du verkligen inaktivera uppdateringspåminnelsen? - - - - - - - + + + + + + + Yes Ja - - - - - - - + + + + + + + No Nej - + The update reminder has been disabled. Uppdateringspåminnelsen har inaktiverats. - + Please remember to check for updates at regular intervals! Glöm inte att söka efter uppdateringar med jämna mellanrum! - + The update reminder has been re-enabled. Uppdateringspåminnelsen har återaktiverats. - + Do you really want to disable all sound effects? Vill du verkligen inaktivera alla ljudeffekter? - - + + Sound Effects Ljudeffekter - + All sound effects have been disabled. Alla ljudeffekter har inaktiverats. - + The sound effects have been re-enabled. Ljudeffekterna har återaktiverats. - - - + + + Nero AAC Notifications Nero AAC-meddelanden - + Do you really want to disable all Nero AAC Encoder notifications? Vill du verkligen inaktivera alla Nero AAC-meddelanden? - + All Nero AAC Encoder notifications have been disabled. Alla Nero AAC-meddelanden har inaktiverats. - + The Nero AAC Encoder notifications have been re-enabled. Nero AAC-meddelanden har återaktiverats. - - - + + + Slow Startup Notifications Meddelande om långsam uppstart - + Do you really want to disable the slow startup notifications? Vill du verkligen inaktivera meddelanden om långsam uppstart? - + The slow startup notifications have been disabled. Meddelanden om långsam uppstart har inaktiverats. - + The slow startup notifications have been re-enabled. Meddelanden om långsam uppstart har återaktiverats. - - + + Open Cue Sheet Öppna cue-fil - - + + Cue Sheet File Cue-fil + + - - Beta Updates Beta-uppdateringar - + Do you really want LameXP to check for Beta (pre-release) updates? Vill du verkligen att LameXP skall söka efter beta-uppdateringar? - + LameXP will check for Beta (pre-release) updates from now on. LameXP kommer i fortsättningen att söka efter beta-uppdatyeringar. - + Check Now Sök nu - + LameXP will <i>not</i> check for Beta (pre-release) updates from now on. LameXP kommer i fortsättningen <i>inte</i> att söka efter beta-uppdateringar. - - - + + + Hibernate Computer Viloläge - + Do you really want the computer to be hibernated on shutdown? Vill du verkligen att datorn skall försättas i viloläge vid avslut? - + LameXP will hibernate the computer on shutdown from now on. LameXP kommer i fortsättningen att försätta datorn i viloläge vid avslut. - + LameXP will <i>not</i> hibernate the computer on shutdown from now on. LameXP kommer i fortsättningen <i>inte</i> att försätta datorn i viloläge vid avslut. - - - + + + Shell Integration Utforskarintegrering - + Do you really want to disable the LameXP shell integration? Vill du verkligen inaktivera LameXPs utforskarintegration? - + The LameXP shell integration has been disabled. LameXPs utforskarintegration har inaktiverats. - + The LameXP shell integration has been re-enabled. LameXPs utforskarintegration har återaktiverats. - - + + Add file(s) Lägg till fil(er) - - + + Add Folder Lägg till mapp - - + + Save CSV file Spara CSV-fil - - - - + + + + CSV File CSV-fil - - - - + + + + CSV Export CSV-export - + Sorry, there are no meta tags that can be exported! Det finns ingen meta-data som kan exporteras! - + Sorry, failed to open CSV file for writing! Kunde inte öppna CSV-filen för skrivning! - + Sorry, failed to write to the CSV file! Kunde inte skriva till CSV-filen! - + The CSV files was created successfully! CSV-filen skapades korrekt! - - + + Open CSV file Öppna CSV-fil - - - - - + + + + + CSV Import CSV-import - + Sorry, failed to open CSV file for reading! Kunde inte öppna CSV-filen för läsning! - + Sorry, failed to read from the CSV file! Kunde inte läsa från CSV-filen! - + Sorry, the CSV file does not contain any known fields! CSV-filen innehåller inga kända fält! - + CSV file is incomplete. Not all files were updated! CSV-filen är inte komplett. Alla filer uppdaterades inte! - + The CSV files was imported successfully! CSV-filen importerades korrekt! - - + + New Folder Ny mapp - + Enter the name of the new folder: Namn på den nya mappen: - + Failed to create folder Kunde inte skapa någon mapp - + The new folder could not be created: Den nya mappen kunde inte skapas: - + Drive is read-only or insufficient access rights! Diskenheten är skrivskyddad eller åtkomsträttigheter saknas! - + Quality Level %1 Kvallitetsnivå %1 - + Compression %1 Kompression %1 - + Uncompressed Okomprimerad - + Best Quality (Slow) Bäst kvalitet (Långsam) - + Acceptable Quality (Fast) Acceptabel kvalitet (Snabb) - + High Quality (Recommended) Hög kvallitet (rekommenderas) - + Current Encoder: %1 - + Poor Quality (Very Fast) Dålig kvallitet (mycket snabb) - + File name without extension Filnamn utan filtillägg - + Track number with leading zero Spårnummer med inledande nolla - + Track title Spårtitel - + Artist name Artistnamn - + Album name Albumnamn - + Year with (at least) four digits Årtal med (minst) fyra siffror - + Comment Kommentar - + Characters forbidden in file names: Förbjudna tecken i filnamn: - + Rename Macros Namnändra macron - + %n Instance(s) %n instans @@ -2560,37 +2560,37 @@ - + Cannot write to the selected directory. Please choose another directory! Kan inte skriva till den specificerade mappen. Välj en annan destination! - + Overwrite Mode Överskrivningsläge - + Warning: This mode may overwrite existing files with no way to revert! Varning! Det här läget kan skriva över befintliga filer, utan möjlighet att återskapa! - + Continue Fortsätt - + Revert Återställ - + Already Running Körs redan - + LameXP is already running, please use the running instance! LameXP körs redan, använd den redan startade instansen! @@ -3072,72 +3072,72 @@ Stäng - + Show details for selected job Visa detaljerad info för markerad åtgärd - + Browse Output File Location Öppna utdatamnappen - + Filter Log Items Filtrera loggobjekt - + Show Running Only Visa endast aktiva - + Show Succeeded Only Visa endast klara - + Show Failed Only Visa endast misslyckade - + Show Skipped Only Visa endast överhoppade - + Show All Items Visa alla - + Encoding Files Kodar om filer - + Your files are being encoded, please be patient... Dina filer kodas om, vänta... - + Encoding files, please wait... Kodar om filer, vänta... - + Multi-threading enabled: Running %1 instances in parallel! Flertrådskörning aktiverad: Kör %1 parallella instanser! - + Aborted! Waiting for running jobs to terminate... Avbrutet! Väntar på att aktiva processer skall avslutas... - + Encoding: %n file(s) of %1 completed so far, please wait... Kodar! %n fil av%1 slutförd. vänta... @@ -3145,17 +3145,17 @@ - + Creating the playlist file, please wait... Skapar spelningslista, vänta... - + Process was aborted prematurely by the user! Åtgärden avbröts i förtid av användaren! - + Process was aborted by the user after %n file(s)! Åtgärden avbröts av användaren efter %n fil! @@ -3163,22 +3163,22 @@ - + LameXP - Aborted LameXP - Avbrutet - + Process was aborted by the user. Åtgärden avbröts av användaren. - + Process finished after %1. Åtgärden slutförd efter %1. - + Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information! Fel! %1 av %n filer misslyckades (%2). Dubbelklicka på misslyckat objekt för info! @@ -3186,7 +3186,7 @@ - + %n file(s) skipped %n fil hoppades över @@ -3194,7 +3194,7 @@ - + Error: %1 of %n file(s) failed. Double-click failed items for detailed information! Fel! %1 av %n filer misslyckades. Dubbelklicka på misslyckat objekt för info! @@ -3202,7 +3202,7 @@ - + All files completed successfully. Skipped %n file(s). Alla filer korrekt slutförda. %n fil hoppades över. @@ -3210,54 +3210,54 @@ - + LameXP - Error LameXP - Fel - + At least one file has failed! Minst en fil har misslyckats! - - + + All files completed successfully. Alla filer korrekt omkodade. - + LameXP - Done LameXP - Klar - + None of the items matches the current filtering rules Inga objekt matchar aktuell filtrering - + Playlist creation failed Kunde inte skapa spelningslista - + The playlist file could not be created: Spelningslistan kunde inte skapas: - + Warning: Computer will shutdown in %1 seconds... Varning! Datorn kommer att stängas av om %1 sekunder... - - + + Cancel Shutdown Avbryt avstängning - + %n hour(s) %n timma @@ -3265,8 +3265,8 @@ - - + + %n minute(s) %n minut @@ -3274,8 +3274,8 @@ - - + + %n second(s) %n sekund @@ -3283,7 +3283,7 @@ - + %n millisecond(s) %n millisekund @@ -3307,23 +3307,23 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. EXE-filen '%1' stöder inte Windows kompatibilitetsläge. - + Executable '%1' requires Qt v%2, but found Qt v%3. EXE-filen '%1' kräver Qt v%2, du har Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. EXE-filen '%1' är byggd för Qt '%2', du har Qt '%3'. - - + + Executable '%1' requires Windows 2000 or later. EXE-filen '%1' kräver Windows 2000 eller senare. @@ -3392,105 +3392,105 @@ Stäng - - + + Build Build - + Unknown Okänd - + Testing your internet connection, please wait... Kontrollerar iInternetanslutningen, vänta... - - + + It appears that the computer currently is offline! Datorn verkar inte vara ansluten till Internet! - - + + Please make sure your computer is connected to the internet and try again. Tillse att datorn är ansluten till Internet och försök igen. - + Network connectivity test has failed! Anslutningskontrollen misslyckades! - + Please make sure your internet connection is working properly and try again. Tillse att Internetuppkopplingen fungerar korrekt och försök igen. - + Checking for new updates online, please wait... Söker nya uppdateringar, vänta... - + Failed to fetch update information from server! Kunde inte hämta uppdateringsinformation från servern! - + Sorry, the update server might be busy at this time. Plase try again later. Uppdateringsservern kan vara upptagen. Försök senare. - + More information available at: Mer information hittas på: - + A new version of LameXP is available! En ny version av LameXP finns tillgänglig! - + We highly recommend all users to install this update as soon as possible. Vi rekommenderar alla användare att installera denna uppdatering så snart som möjligt. - + No new updates available at this time. Det finns inga nya uppdateringar. - + Your version of LameXP is still up-to-date. Please check for updates regularly! Din version av LameXP är uppdaterad. Kontrollera regelbundet! - + Your version appears to be newer than the latest release. Din version verkar vara nyare än senaste 'Release'. - + This usually indicates your are currently using a pre-release version of LameXP. Det innebär normalt att du använder en beta-version av LameXP. - + Update is being downloaded, please be patient... Uppdatering laddas ner, vänta... - + Update ready to install. Applicaion will quit... Uppdatering klar att installeras. Programmet kommer att avslutas... - + Update failed. Please try again or download manually! Uppdateringen misslyckades. Försök igen, eller ladda ner manuellt! diff --git a/src/Config.h b/src/Config.h index 635c082e..771c345d 100644 --- a/src/Config.h +++ b/src/Config.h @@ -34,7 +34,7 @@ #define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 1357 +#define VER_LAMEXP_BUILD 1361 #define VER_LAMEXP_CONFG 1348 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp index 35312f27..d5a97e95 100644 --- a/src/Dialog_About.cpp +++ b/src/Dialog_About.cpp @@ -47,13 +47,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - //Helper macros #define LINK(URL) QString("%2").arg(URL).arg(QString(URL).replace("-", "−")) #define TRIM_RIGHT(STR) do { while(STR.endsWith(QChar(' ')) || STR.endsWith(QChar('\t')) || STR.endsWith(QChar('\r')) || STR.endsWith(QChar('\n'))) STR.chop(1); } while(0) @@ -114,10 +107,7 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta //Disable "X" button if(firstStart) { - if(HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE)) - { - EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); - } + lamexp_enable_close_button(this, false); } //Init images @@ -220,14 +210,14 @@ int AboutDialog::exec() { if(m_firstShow) { - if(!playResoureSound("imageres.dll", 5080, true)) + if(!lamexp_play_sound_file("imageres.dll", 5080, true)) { - PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC); + lamexp_play_sound(0, true, L"SystemStart"); } } else { - PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + lamexp_play_sound(IDR_WAVE_ABOUT, true); } } @@ -321,7 +311,7 @@ void AboutDialog::openURL(const QString &url) { if(!QDesktopServices::openUrl(QUrl(url))) { - ShellExecuteW(this->winId(), L"open", QWCHAR(url), NULL, NULL, SW_SHOW); + lamexp_exec_shell(this, url); } } @@ -341,16 +331,17 @@ void AboutDialog::gotoLicenseTab(void) void AboutDialog::moveDisque(void) { int delta = 2; - LARGE_INTEGER perfCount, perfFrequ; + const __int64 perfFrequ = lamexp_perfcounter_frequ(); + const __int64 perfCount = lamexp_perfcounter_value(); - if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount)) + if((perfFrequ >= 0) && (perfCount >= 0)) { if(m_disqueDelay != _I64_MAX) { - const double delay = static_cast(perfCount.QuadPart) - static_cast(m_disqueDelay); - delta = qMax(1, qMin(128, static_cast(ceil(delay / static_cast(perfFrequ.QuadPart) / 0.00512)))); + const double delay = static_cast(perfCount) - static_cast(m_disqueDelay); + delta = qMax(1, qMin(128, static_cast(ceil(delay / static_cast(perfFrequ) / 0.00512)))); } - m_disqueDelay = perfCount.QuadPart; + m_disqueDelay = perfCount; } if(m_disque) @@ -876,43 +867,3 @@ QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBi return toolText; } - - -bool AboutDialog::playResoureSound(const QString &library, const unsigned long soundId, const bool async) -{ - HMODULE module = 0; - DWORD flags = SND_RESOURCE; - bool result = false; - - QFileInfo libraryFile(library); - if(!libraryFile.isAbsolute()) - { - unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1; - wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t)); - unsigned int result = GetSystemDirectory(buffer, buffSize); - if(result > 0 && result < buffSize) - { - libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast(buffer))), library)); - } - _freea(buffer); - } - - if(async) - { - flags |= SND_ASYNC; - } - else - { - flags |= SND_SYNC; - } - - module = LoadLibraryW(reinterpret_cast(QDir::toNativeSeparators(libraryFile.absoluteFilePath()).utf16())); - - if(module) - { - result = PlaySound((LPCTSTR) soundId, module, flags); - FreeLibrary(module); - } - - return result; -} \ No newline at end of file diff --git a/src/Dialog_About.h b/src/Dialog_About.h index 6ebee743..cde8b737 100644 --- a/src/Dialog_About.h +++ b/src/Dialog_About.h @@ -85,5 +85,4 @@ private: void initLicenseTab(void); QString makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo = QString()); - bool playResoureSound(const QString &library, const unsigned long soundId, const bool async); }; diff --git a/src/Dialog_LogView.cpp b/src/Dialog_LogView.cpp index ec70fdf6..c4f04b45 100644 --- a/src/Dialog_LogView.cpp +++ b/src/Dialog_LogView.cpp @@ -33,11 +33,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include - LogViewDialog::LogViewDialog(QWidget *parent) : QDialog(parent), @@ -91,7 +86,7 @@ void LogViewDialog::copyButtonClicked(void) ui->buttonCopy->setIcon(*m_acceptIcon); ui->buttonCopy->blockSignals(true); QTimer::singleShot(1250, this, SLOT(restoreIcon())); - MessageBeep(MB_ICONINFORMATION); + lamexp_beep(lamexp_beep_info); } void LogViewDialog::saveButtonClicked(void) diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 295fede9..eee73d54 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -73,13 +73,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - //////////////////////////////////////////////////////////// // Helper macros //////////////////////////////////////////////////////////// @@ -88,7 +81,7 @@ { \ if(m_banner->isVisible() || m_delayedFileTimer->isActive()) \ { \ - MessageBeep(MB_ICONEXCLAMATION); \ + lamexp_beep(lamexp_beep_warning); \ return; \ } \ } \ @@ -168,7 +161,7 @@ while(0) //#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP)) #define CENTER_CURRENT_OUTPUT_FOLDER_DELAYED QTimer::singleShot(125, this, SLOT(centerOutputFolderModel())) -static const DWORD IDM_ABOUTBOX = 0xEFF0; +static const unsigned int IDM_ABOUTBOX = 0xEFF0; //////////////////////////////////////////////////////////// // Constructor @@ -204,11 +197,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabPageChanged(int))); //Add system menu - if(HMENU hMenu = ::GetSystemMenu(winId(), FALSE)) - { - AppendMenuW(hMenu, MF_SEPARATOR, 0, 0); - AppendMenuW(hMenu, MF_STRING, IDM_ABOUTBOX, L"About..."); - } + lamexp_append_sysmenu(this, IDM_ABOUTBOX, "About..."); //-------------------------------- // Setup "Source" tab @@ -758,13 +747,13 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed) m_banner->show(tr("Scanning folder(s) for files, please wait...")); QApplication::processEvents(); - GetAsyncKeyState(VK_ESCAPE); + lamexp_check_escape_state(); while(!folderInfoList.isEmpty()) { - if(GetAsyncKeyState(VK_ESCAPE) & 0x0001) + if(lamexp_check_escape_state()) { - MessageBeep(MB_ICONERROR); + lamexp_beep(lamexp_beep_error); qWarning("Operation cancelled by user!"); fileList.clear(); break; @@ -1022,10 +1011,7 @@ void MainWindow::changeEvent(QEvent *e) } //Translate system menu - if(HMENU hMenu = ::GetSystemMenu(winId(), FALSE)) - { - ModifyMenu(hMenu, IDM_ABOUTBOX, MF_STRING | MF_BYCOMMAND, IDM_ABOUTBOX, QWCHAR(ui->buttonAbout->text())); - } + lamexp_update_sysmenu(this, IDM_ABOUTBOX, ui->buttonAbout->text()); //Force resize, if needed tabPageChanged(ui->tabWidget->currentIndex()); @@ -1105,7 +1091,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { if(m_banner->isVisible() || m_delayedFileTimer->isActive()) { - MessageBeep(MB_ICONEXCLAMATION); + lamexp_beep(lamexp_beep_warning); event->ignore(); } @@ -1150,7 +1136,7 @@ void MainWindow::keyPressEvent(QKeyEvent *e) if(e->modifiers().testFlag(Qt::ControlModifier) && (e->key() == Qt::Key_F5)) { initializeTranslation(); - MessageBeep(MB_ICONINFORMATION); + lamexp_beep(lamexp_beep_info); return; } @@ -1215,7 +1201,7 @@ bool MainWindow::event(QEvent *e) bool MainWindow::winEvent(MSG *message, long *result) { - if((message->message == WM_SYSCOMMAND) && ((message->wParam & 0xFFF0) == IDM_ABOUTBOX)) + if(lamexp_check_sysmenu_msg(message, IDM_ABOUTBOX)) { QTimer::singleShot(0, ui->buttonAbout, SLOT(click())); *result = 0; @@ -1268,7 +1254,7 @@ void MainWindow::windowShown(void) m_settings->licenseAccepted(++iAccepted); m_settings->syncNow(); QApplication::processEvents(); - PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + lamexp_play_sound(IDR_WAVE_WHAMMY, false); QMessageBox::critical(this, tr("License Declined"), tr("You have declined the license. Consequently the application will exit now!"), tr("Goodbye!")); QFileInfo uninstallerInfo = QFileInfo(QString("%1/Uninstall.exe").arg(QApplication::applicationDirPath())); if(uninstallerInfo.exists()) @@ -1277,15 +1263,14 @@ void MainWindow::windowShown(void) QString uninstallerPath = uninstallerInfo.canonicalFilePath(); for(int i = 0; i < 3; i++) { - HINSTANCE res = ShellExecuteW(reinterpret_cast(this->winId()), L"open", QWCHAR(QDir::toNativeSeparators(uninstallerPath)), L"/Force", QWCHAR(QDir::toNativeSeparators(uninstallerDir)), SW_SHOWNORMAL); - if(reinterpret_cast(res) > 32) break; + if(lamexp_exec_shell(this, QDir::toNativeSeparators(uninstallerPath), "/Force", QDir::toNativeSeparators(uninstallerDir))) break; } } QApplication::quit(); return; } - PlaySound(MAKEINTRESOURCE(IDR_WAVE_WOOHOO), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + lamexp_play_sound(IDR_WAVE_WOOHOO, false); m_settings->licenseAccepted(1); m_settings->syncNow(); if(lamexp_version_demo()) showAnnounceBox(); @@ -1297,7 +1282,7 @@ void MainWindow::windowShown(void) if(lamexp_current_date_safe() >= lamexp_version_expires()) { qWarning("Binary has expired !!!"); - PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + lamexp_play_sound(IDR_WAVE_WHAMMY, false); if(QMessageBox::warning(this, tr("LameXP - Expired"), QString("%1
    %2").arg(NOBR(tr("This demo (pre-release) version of LameXP has expired at %1.").arg(lamexp_version_expires().toString(Qt::ISODate))), NOBR(tr("LameXP is free software and release versions won't expire."))), tr("Check for Updates"), tr("Exit Program")) == 0) { checkForUpdates(); @@ -1339,7 +1324,7 @@ void MainWindow::windowShown(void) return; default: QEventLoop loop; QTimer::singleShot(7000, &loop, SLOT(quit())); - PlaySound(MAKEINTRESOURCE(IDR_WAVE_WAITING), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + lamexp_play_sound(IDR_WAVE_WAITING, true); m_banner->show(tr("Skipping update check this time, please be patient..."), &loop); break; } @@ -1542,7 +1527,7 @@ void MainWindow::encodeButtonClicked(void) { QStringList tempFolderParts = tempFolder.split("/", QString::SkipEmptyParts, Qt::CaseInsensitive); tempFolderParts.takeLast(); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_WHAMMY, false); QString lowDiskspaceMsg = QString("%1
    %2

    %3
    %4
    ").arg ( NOBR(tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.").arg(QString::number(minimumFreeDiskspaceMultiplier))), @@ -2365,70 +2350,17 @@ void MainWindow::sourceFilesScrollbarMoved(int) */ void MainWindow::previewContextActionTriggered(void) { - const static wchar_t *registryPrefix[2] = { L"SOFTWARE\\", L"SOFTWARE\\Wow6432Node\\" }; - const static wchar_t *registryKeys[3] = - { - L"Microsoft\\Windows\\CurrentVersion\\Uninstall\\{97D341C8-B0D1-4E4A-A49A-C30B52F168E9}", - L"Microsoft\\Windows\\CurrentVersion\\Uninstall\\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}", - L"foobar2000" - }; - const static wchar_t *appNames[4] = { L"smplayer_portable.exe", L"smplayer.exe", L"MPUI.exe", L"foobar2000.exe" }; - const static wchar_t *valueNames[2] = { L"InstallLocation", L"InstallDir" }; - QModelIndex index = ui->sourceFileView->currentIndex(); if(!index.isValid()) { return; } - for(size_t i = 0; i < 3; i++) + if(!lamexp_open_media_file(m_fileListModel->getFile(index).filePath())) { - for(size_t j = 0; j < 2; j++) - { - QString mplayerPath; - HKEY registryKeyHandle = NULL; - - const QString currentKey = WCHAR2QSTR(registryPrefix[j]).append(WCHAR2QSTR(registryKeys[i])); - if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, QWCHAR(currentKey), 0, KEY_READ, ®istryKeyHandle) == ERROR_SUCCESS) - { - for(size_t k = 0; k < 2; k++) - { - wchar_t Buffer[4096]; - DWORD BuffSize = sizeof(wchar_t*) * 4096; - DWORD DataType = REG_NONE; - if(RegQueryValueExW(registryKeyHandle, valueNames[k], 0, &DataType, reinterpret_cast(Buffer), &BuffSize) == ERROR_SUCCESS) - { - if((DataType == REG_SZ) || (DataType == REG_EXPAND_SZ) || (DataType == REG_LINK)) - { - mplayerPath = WCHAR2QSTR(Buffer); - break; - } - } - } - RegCloseKey(registryKeyHandle); - } - - if(!mplayerPath.isEmpty()) - { - QDir mplayerDir(mplayerPath); - if(mplayerDir.exists()) - { - for(size_t k = 0; k < 4; k++) - { - if(mplayerDir.exists(WCHAR2QSTR(appNames[k]))) - { - qDebug("Player found at:\n%s\n", mplayerDir.absoluteFilePath(WCHAR2QSTR(appNames[k])).toUtf8().constData()); - QProcess::startDetached(mplayerDir.absoluteFilePath(WCHAR2QSTR(appNames[k])), QStringList() << QDir::toNativeSeparators(m_fileListModel->getFile(index).filePath())); - return; - } - } - } - } - } + qDebug("Player not found, falling back to default application..."); + QDesktopServices::openUrl(QString("file:///").append(m_fileListModel->getFile(index).filePath())); } - - qDebug("Player not found, falling back to default application..."); - QDesktopServices::openUrl(QString("file:///").append(m_fileListModel->getFile(index).filePath())); } /* @@ -2750,7 +2682,7 @@ void MainWindow::gotoFavoriteFolder(void) } else { - MessageBeep(MB_ICONERROR); + lamexp_beep(lamexp_beep_error); m_outputFolderFavoritesMenu->removeAction(item); item->deleteLater(); } @@ -2822,7 +2754,7 @@ void MainWindow::makeFolderButtonClicked(void) if(folderName.isEmpty()) { - MessageBeep(MB_ICONERROR); + lamexp_beep(lamexp_beep_error); continue; } @@ -2897,7 +2829,7 @@ void MainWindow::showFolderContextActionTriggered(void) QString path = QDir::toNativeSeparators(m_fileSystemModel->filePath(ui->outputFolderView->currentIndex())); if(!path.endsWith(QDir::separator())) path.append(QDir::separator()); - ShellExecuteW(reinterpret_cast(this->winId()), L"explore", QWCHAR(path), NULL, NULL, SW_SHOW); + lamexp_exec_shell(this, path, true); } /* @@ -2926,7 +2858,7 @@ void MainWindow::goUpFolderContextActionTriggered(void) } else { - MessageBeep(MB_ICONWARNING); + lamexp_beep(lamexp_beep_warning); } CENTER_CURRENT_OUTPUT_FOLDER_DELAYED; } @@ -2947,7 +2879,7 @@ void MainWindow::addFavoriteFolderActionTriggered(void) } else { - MessageBeep(MB_ICONWARNING); + lamexp_beep(lamexp_beep_warning); } m_settings->favoriteOutputFolders(favorites.join("|")); @@ -3013,7 +2945,7 @@ void MainWindow::outputFolderEditFinished(void) ui->outputFolderLabel->setVisible(true); ui->outputFolderView->setEnabled(true); - if(!ok) MessageBeep(MB_ICONERROR); + if(!ok) lamexp_beep(lamexp_beep_error); CENTER_CURRENT_OUTPUT_FOLDER_DELAYED; } @@ -3168,7 +3100,7 @@ void MainWindow::outputFolderMouseEventOccurred(QWidget *sender, QEvent *event) { QString path = ui->outputFolderLabel->text(); if(!path.endsWith(QDir::separator())) path.append(QDir::separator()); - ShellExecuteW(reinterpret_cast(this->winId()), L"explore", QWCHAR(path), NULL, NULL, SW_SHOW); + lamexp_exec_shell(this, path, true); } break; case QEvent::Enter: @@ -3455,7 +3387,7 @@ void MainWindow::compressionTabEventOccurred(QWidget *sender, QEvent *event) { if(m_settings->soundsEnabled()) { - PlaySound(MAKEINTRESOURCE(IDR_WAVE_BLAST), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + lamexp_play_sound(IDR_WAVE_BLAST, true); } EncoderRegistry::resetAllEncoders(m_settings); @@ -3745,7 +3677,7 @@ void MainWindow::renameOutputPatternChanged(const QString &text, bool silent) { if(ui->lineEditRenamePattern->palette().color(QPalette::Text) != Qt::red) { - if(!silent) MessageBeep(MB_ICONERROR); + if(!silent) lamexp_beep(lamexp_beep_error); SET_TEXT_COLOR(ui->lineEditRenamePattern, Qt::red); } } @@ -3753,7 +3685,7 @@ void MainWindow::renameOutputPatternChanged(const QString &text, bool silent) { if(ui->lineEditRenamePattern->palette() != QPalette()) { - if(!silent) MessageBeep(MB_ICONINFORMATION); + if(!silent) lamexp_beep(lamexp_beep_info); ui->lineEditRenamePattern->setPalette(QPalette()); } } @@ -3892,13 +3824,13 @@ void MainWindow::customParamsHelpRequested(QWidget *obj, QEvent *event) case SettingsModel::AAC_ENCODER_QAAC: showCustomParamsHelpScreen("qaac.exe", "--help"); break; case SettingsModel::AAC_ENCODER_FHG : showCustomParamsHelpScreen("fhgaacenc.exe", ""); break; case SettingsModel::AAC_ENCODER_NERO: showCustomParamsHelpScreen("neroAacEnc.exe", "-help"); break; - default: MessageBeep(MB_ICONERROR); break; + default: lamexp_beep(lamexp_beep_error); break; } } else if(obj == ui->helpCustomParamFLAC) showCustomParamsHelpScreen("flac.exe", "--help"); else if(obj == ui->helpCustomParamAften) showCustomParamsHelpScreen("aften.exe", "-h"); else if(obj == ui->helpCustomParamOpus) showCustomParamsHelpScreen("opusenc.exe", "--help"); - else MessageBeep(MB_ICONERROR); + else lamexp_beep(lamexp_beep_error); } /* @@ -3909,7 +3841,7 @@ void MainWindow::showCustomParamsHelpScreen(const QString &toolName, const QStri const QString binary = lamexp_lookup_tool(toolName); if(binary.isEmpty()) { - MessageBeep(MB_ICONERROR); + lamexp_beep(lamexp_beep_error); qWarning("customParamsHelpRequested: Binary could not be found!"); return; } @@ -3954,7 +3886,7 @@ void MainWindow::showCustomParamsHelpScreen(const QString &toolName, const QStri if(output.count() < 1) { qWarning("Empty output, cannot show help screen!"); - MessageBeep(MB_ICONERROR); + lamexp_beep(lamexp_beep_error); } LogViewDialog *dialog = new LogViewDialog(this); @@ -3984,7 +3916,7 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void) { if(m_settings->soundsEnabled()) { - PlaySound(MAKEINTRESOURCE(IDR_WAVE_BLAST), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + lamexp_play_sound(IDR_WAVE_BLAST, true); } ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQualityDefault()); diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index 3ddb4c7b..88a4a2b7 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -61,12 +61,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include -#include - #include #include @@ -358,15 +352,12 @@ void ProcessingDialog::showEvent(QShowEvent *event) { static const char *NA = " N/A"; - setCloseButtonEnabled(false); + lamexp_enable_close_button(this, false); ui->button_closeDialog->setEnabled(false); ui->button_AbortProcess->setEnabled(false); m_systemTray->setVisible(true); - - if(!SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS)) - { - SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); - } + + lamexp_change_process_priority(1); ui->label_cpu->setText(NA); ui->label_disk->setText(NA); @@ -539,11 +530,7 @@ void ProcessingDialog::initEncoding(void) qApp->processEvents(); } - LARGE_INTEGER counter; - if(QueryPerformanceCounter(&counter)) - { - m_timerStart = counter.QuadPart; - } + m_timerStart = lamexp_perfcounter_value(); } void ProcessingDialog::abortEncoding(bool force) @@ -610,17 +597,18 @@ void ProcessingDialog::doneEncoding(void) QApplication::processEvents(); if(m_settings->soundsEnabled() && !m_forcedAbort) { - PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABORTED), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + lamexp_play_sound(IDR_WAVE_ABORTED, false); } } else { - LARGE_INTEGER counter, frequency; - if(QueryPerformanceCounter(&counter) && QueryPerformanceFrequency(&frequency)) + const __int64 counter = lamexp_perfcounter_value(); + const __int64 frequency = lamexp_perfcounter_frequ(); + if((counter >= 0I64) && (frequency >= 0)) { - if((m_timerStart > 0I64) && (frequency.QuadPart > 0I64) && (m_timerStart < counter.QuadPart)) + if((m_timerStart >= 0I64) && (m_timerStart < counter)) { - double timeElapsed = static_cast(counter.QuadPart - m_timerStart) / static_cast(frequency.QuadPart); + double timeElapsed = static_cast(counter - m_timerStart) / static_cast(frequency); m_progressModel->addSystemMessage(tr("Process finished after %1.").arg(time2text(timeElapsed)), ProgressModel::SysMsg_Performance); } } @@ -641,7 +629,7 @@ void ProcessingDialog::doneEncoding(void) m_systemTray->showMessage(tr("LameXP - Error"), tr("At least one file has failed!"), QSystemTrayIcon::Critical); m_systemTray->setIcon(QIcon(":/icons/cd_delete.png")); QApplication::processEvents(); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_ERROR, false); } else { @@ -659,11 +647,11 @@ void ProcessingDialog::doneEncoding(void) m_systemTray->showMessage(tr("LameXP - Done"), tr("All files completed successfully."), QSystemTrayIcon::Information); m_systemTray->setIcon(QIcon(":/icons/cd_add.png")); QApplication::processEvents(); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_SUCCESS), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_SUCCESS, false); } } - setCloseButtonEnabled(true); + lamexp_enable_close_button(this, true); ui->button_closeDialog->setEnabled(true); ui->button_AbortProcess->setEnabled(false); ui->checkBox_shutdownComputer->setEnabled(false); @@ -741,7 +729,7 @@ void ProcessingDialog::logViewDoubleClicked(const QModelIndex &index) } else { - MessageBeep(MB_ICONWARNING); + lamexp_beep(lamexp_beep_warning); } } @@ -781,7 +769,7 @@ void ProcessingDialog::contextMenuShowFileActionTriggered(void) if(filePath.isEmpty()) { - MessageBeep(MB_ICONWARNING); + lamexp_beep(lamexp_beep_warning); return; } @@ -812,7 +800,7 @@ void ProcessingDialog::contextMenuShowFileActionTriggered(void) else { qWarning("File not found: %s", filePath.toLatin1().constData()); - MessageBeep(MB_ICONERROR); + lamexp_beep(lamexp_beep_error); } } @@ -1204,17 +1192,11 @@ AudioFileModel ProcessingDialog::updateMetaInfo(const AudioFileModel &audioFile) return result; } -void ProcessingDialog::setCloseButtonEnabled(bool enabled) -{ - HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE); - EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | (enabled ? MF_ENABLED : MF_GRAYED)); -} - void ProcessingDialog::systemTrayActivated(QSystemTrayIcon::ActivationReason reason) { if(reason == QSystemTrayIcon::DoubleClick) { - SetForegroundWindow(reinterpret_cast(this->winId())); + lamexp_bring_to_front(this); } } @@ -1271,7 +1253,7 @@ bool ProcessingDialog::shutdownComputer(void) if(m_settings->soundsEnabled()) { QApplication::setOverrideCursor(Qt::WaitCursor); - PlaySound(MAKEINTRESOURCE(IDR_WAVE_SHUTDOWN), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + lamexp_play_sound(IDR_WAVE_SHUTDOWN, false); QApplication::restoreOverrideCursor(); } @@ -1295,7 +1277,7 @@ bool ProcessingDialog::shutdownComputer(void) progressDialog.setLabelText(text.arg(iTimeout-i)); if(iTimeout-i == 3) progressDialog.setCancelButton(NULL); QApplication::processEvents(); - PlaySound(MAKEINTRESOURCE((i < iTimeout) ? IDR_WAVE_BEEP : IDR_WAVE_BEEP_LONG), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); + lamexp_play_sound(((i < iTimeout) ? IDR_WAVE_BEEP : IDR_WAVE_BEEP_LONG), false); } progressDialog.close(); diff --git a/src/Dialog_Processing.h b/src/Dialog_Processing.h index 28a59d03..63ffa265 100644 --- a/src/Dialog_Processing.h +++ b/src/Dialog_Processing.h @@ -93,7 +93,6 @@ protected: private: Ui::ProcessingDialog *ui; //for Qt UIC - void setCloseButtonEnabled(bool enabled); void startNextJob(void); AudioFileModel updateMetaInfo(const AudioFileModel &audioFile); void writePlayList(void); diff --git a/src/Dialog_SplashScreen.cpp b/src/Dialog_SplashScreen.cpp index e79af7af..6c361d0b 100644 --- a/src/Dialog_SplashScreen.cpp +++ b/src/Dialog_SplashScreen.cpp @@ -28,11 +28,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include - #include "WinSevenTaskbar.h" #define FADE_DELAY 16 @@ -140,7 +135,7 @@ void SplashScreen::showSplash(QThread *thread) splashScreen->update(); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, FADE_DELAY); SET_TASKBAR_STATE(true); - Sleep(FADE_DELAY); + lamexp_sleep(FADE_DELAY); } //Start the timer @@ -171,7 +166,7 @@ void SplashScreen::showSplash(QThread *thread) splashScreen->setWindowOpacity(opacity); splashScreen->update(); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, FADE_DELAY); - Sleep(FADE_DELAY); + lamexp_sleep(FADE_DELAY); } //Restore taskbar diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp index 403e4a05..6d6f77e0 100644 --- a/src/Dialog_Update.cpp +++ b/src/Dialog_Update.cpp @@ -44,13 +44,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - /////////////////////////////////////////////////////////////////////////////// static const char *header_id = "!Update"; @@ -169,28 +162,6 @@ static const int MIN_CONNSCORE = 8; static const int VERSION_INFO_EXPIRES_MONTHS = 6; static char *USER_AGENT_STR = "Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20111106 IceCat/7.0.1"; -static BOOL getInternetConnectedState(void) -{ - DWORD lpdwFlags = NULL; - BOOL result = InternetGetConnectedState(&lpdwFlags, NULL); - return result; -} - -static BOOL CALLBACK focusUpdaterWindow(HWND hwnd, LPARAM lParam) -{ - DWORD processId = *reinterpret_cast(lParam); - DWORD windowProcessId = NULL; - GetWindowThreadProcessId(hwnd, &windowProcessId); - if(windowProcessId == processId) - { - SwitchToThisWindow(hwnd, TRUE); - SetForegroundWindow(hwnd); - return FALSE; - } - - return TRUE; -} - /////////////////////////////////////////////////////////////////////////////// class UpdateInfo @@ -245,8 +216,7 @@ UpdateDialog::UpdateDialog(SettingsModel *settings, QWidget *parent) setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint); //Disable "X" button - HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE); - EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); + lamexp_enable_close_button(this, false); //Init animation m_animator = new QMovie(":/images/Loading3.gif"); @@ -354,7 +324,7 @@ bool UpdateDialog::event(QEvent *e) { if((e->type() == QEvent::ActivationChange) && (m_updaterProcess != NULL)) { - EnumWindows(focusUpdaterWindow, reinterpret_cast(&m_updaterProcess)); + lamexp_bring_process_to_front(m_updaterProcess); } return QDialog::event(e); } @@ -403,7 +373,7 @@ void UpdateDialog::checkForUpdates(void) m_logFile->clear(); m_logFile->append("Checking internet connection..."); - QFuture connectedState = QtConcurrent::run(getInternetConnectedState); + QFuture connectedState = QtConcurrent::run(lamexp_get_connection_state); while(!connectedState.isFinished()) { QApplication::processEvents(QEventLoop::WaitForMoreEvents); @@ -425,7 +395,7 @@ void UpdateDialog::checkForUpdates(void) ui->hintIcon->show(); ui->hintLabel->show(); LAMEXP_DELETE(m_updateInfo); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_ERROR, true); QApplication::restoreOverrideCursor(); ui->progressBar->setValue(ui->progressBar->maximum()); WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarErrorState); @@ -458,14 +428,14 @@ void UpdateDialog::checkForUpdates(void) connectionScore++; ui->progressBar->setValue(qBound(1, connectionScore + 1, MIN_CONNSCORE + 1)); QApplication::processEvents(); - Sleep(64); + lamexp_sleep(64); } if(httpOk) { connectionScore++; ui->progressBar->setValue(qBound(1, connectionScore + 1, MIN_CONNSCORE + 1)); QApplication::processEvents(); - Sleep(64); + lamexp_sleep(64); } QFile::remove(outFile); } @@ -486,7 +456,7 @@ void UpdateDialog::checkForUpdates(void) ui->hintIcon->show(); ui->hintLabel->show(); LAMEXP_DELETE(m_updateInfo); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_ERROR, true); QApplication::restoreOverrideCursor(); ui->progressBar->setValue(ui->progressBar->maximum()); WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarErrorState); @@ -536,7 +506,7 @@ void UpdateDialog::checkForUpdates(void) else { QApplication::processEvents(); - Sleep(64); + lamexp_sleep(64); } } @@ -560,7 +530,7 @@ void UpdateDialog::checkForUpdates(void) ui->hintIcon->show(); ui->hintLabel->show(); LAMEXP_DELETE(m_updateInfo); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_ERROR, true); return; } @@ -581,7 +551,7 @@ void UpdateDialog::checkForUpdates(void) ui->hintIcon->show(); ui->hintLabel->show(); WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/shield_exclamation.png")); - MessageBeep(MB_ICONINFORMATION); + lamexp_beep(lamexp_beep_info); } else if(m_updateInfo->m_buildNo == lamexp_version_build()) { @@ -592,7 +562,7 @@ void UpdateDialog::checkForUpdates(void) ui->hintIcon->show(); ui->hintLabel->show(); WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/shield_green.png")); - MessageBeep(MB_ICONINFORMATION); + lamexp_beep(lamexp_beep_info); } else { @@ -603,7 +573,7 @@ void UpdateDialog::checkForUpdates(void) ui->hintIcon->show(); ui->hintLabel->show(); WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/shield_error.png")); - MessageBeep(MB_ICONEXCLAMATION); + lamexp_beep(lamexp_beep_warning); } ui->closeButton->setEnabled(true); @@ -922,7 +892,7 @@ void UpdateDialog::applyUpdate(void) bool updateStarted = process.waitForStarted(); if(updateStarted) { - m_updaterProcess = process.pid()->dwProcessId; + m_updaterProcess = lamexp_process_id(&process); loop.exec(); } m_updaterProcess = NULL; @@ -995,7 +965,7 @@ void UpdateDialog::testKnownWebSites(void) m_logFile->clear(); m_logFile->append("Checking internet connection..."); - QFuture connectedState = QtConcurrent::run(getInternetConnectedState); + QFuture connectedState = QtConcurrent::run(lamexp_get_connection_state); while(!connectedState.isFinished()) { QApplication::processEvents(QEventLoop::WaitForMoreEvents); @@ -1017,7 +987,7 @@ void UpdateDialog::testKnownWebSites(void) ui->hintIcon->show(); ui->hintLabel->show(); LAMEXP_DELETE(m_updateInfo); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_ERROR, true); QApplication::restoreOverrideCursor(); ui->progressBar->setValue(ui->progressBar->maximum()); WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarErrorState); @@ -1078,7 +1048,7 @@ void UpdateDialog::testKnownWebSites(void) ui->hintIcon->show(); ui->hintLabel->show(); LAMEXP_DELETE(m_updateInfo); - if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); + if(m_settings->soundsEnabled()) lamexp_play_sound(IDR_WAVE_ERROR, true); QApplication::restoreOverrideCursor(); ui->progressBar->setValue(ui->progressBar->maximum()); WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarErrorState); @@ -1098,7 +1068,7 @@ void UpdateDialog::testKnownWebSites(void) ui->hintIcon->show(); ui->hintLabel->show(); WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/shield_green.png")); - MessageBeep(MB_ICONINFORMATION); + lamexp_beep(lamexp_beep_info); ui->closeButton->setEnabled(true); if(ui->retryButton->isVisible()) ui->retryButton->hide(); diff --git a/src/Global.cpp b/src/Global.cpp index 7ad88cbb..d5e166e1 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -25,6 +25,9 @@ #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include +#include +#include +#include //Qt includes #include @@ -53,6 +56,7 @@ #include #include #include +#include //LameXP includes #define LAMEXP_INC_CONFIG @@ -2457,6 +2461,382 @@ void lamexp_natural_string_sort(QStringList &list, const bool bIgnoreCase) qSort(list.begin(), list.end(), bIgnoreCase ? lamexp_natural_string_sort_helper_fold_case : lamexp_natural_string_sort_helper); } +/* + * Suspend calling thread for N milliseconds + */ +void lamexp_sleep(const unsigned int delay) +{ + Sleep(delay); +} + +bool lamexp_beep(int beepType) +{ + switch(beepType) + { + case lamexp_beep_info: return MessageBeep(MB_ICONASTERISK) == TRUE; break; + case lamexp_beep_warning: return MessageBeep(MB_ICONEXCLAMATION) == TRUE; break; + case lamexp_beep_error: return MessageBeep(MB_ICONHAND) == TRUE; break; + default: return false; + } +} + +/* + * Play a sound (from resources) + */ +bool lamexp_play_sound(const unsigned short uiSoundIdx, const bool bAsync, const wchar_t *alias) +{ + if(alias) + { + return PlaySound(alias, GetModuleHandle(NULL), (SND_ALIAS | (bAsync ? SND_ASYNC : SND_SYNC))) == TRUE; + } + else + { + return PlaySound(MAKEINTRESOURCE(uiSoundIdx), GetModuleHandle(NULL), (SND_RESOURCE | (bAsync ? SND_ASYNC : SND_SYNC))) == TRUE; + } +} + +/* + * Play a sound (from resources) + */ +bool lamexp_play_sound_file(const QString &library, const unsigned short uiSoundIdx, const bool bAsync) +{ + bool result = false; + HMODULE module = NULL; + + QFileInfo libraryFile(library); + if(!libraryFile.isAbsolute()) + { + unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1; + wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t)); + unsigned int result = GetSystemDirectory(buffer, buffSize); + if(result > 0 && result < buffSize) + { + libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast(buffer))), library)); + } + _freea(buffer); + } + + module = LoadLibraryW(QWCHAR(QDir::toNativeSeparators(libraryFile.absoluteFilePath()))); + if(module) + { + result = (PlaySound(MAKEINTRESOURCE(uiSoundIdx), module, (SND_RESOURCE | (bAsync ? SND_ASYNC : SND_SYNC))) == TRUE); + FreeLibrary(module); + } + + return result; +} + +/* + * Open file using the shell + */ +bool lamexp_exec_shell(const QWidget *win, const QString &url, const bool explore) +{ + return lamexp_exec_shell(win, url, QString(), QString(), explore); +} + +/* + * Open file using the shell (with parameters) + */ +bool lamexp_exec_shell(const QWidget *win, const QString &url, const QString ¶meters, const QString &directory, const bool explore) +{ + return ((int) ShellExecuteW(((win) ? win->winId() : NULL), (explore ? L"explore" : L"open"), QWCHAR(url), ((!parameters.isEmpty()) ? QWCHAR(parameters) : NULL), ((!directory.isEmpty()) ? QWCHAR(directory) : NULL), SW_SHOW)) > 32; +} + + /* + * Query value of the performance counter + */ +__int64 lamexp_perfcounter_value(void) +{ + LARGE_INTEGER counter; + if(QueryPerformanceCounter(&counter) == TRUE) + { + return counter.QuadPart; + } + return -1; +} + +/* + * Query frequency of the performance counter + */ +__int64 lamexp_perfcounter_frequ(void) +{ + LARGE_INTEGER frequency; + if(QueryPerformanceFrequency(&frequency) == TRUE) + { + return frequency.QuadPart; + } + return -1; +} + +/* + * Insert entry to the window's system menu + */ +bool lamexp_append_sysmenu(const QWidget *win, const unsigned int identifier, const QString &text) +{ + bool ok = false; + + if(HMENU hMenu = GetSystemMenu(win->winId(), FALSE)) + { + ok = (AppendMenuW(hMenu, MF_SEPARATOR, 0, 0) == TRUE); + ok = (AppendMenuW(hMenu, MF_STRING, identifier, QWCHAR(text)) == TRUE); + } + + return ok; +} + +/* + * Insert entry to the window's system menu + */ +bool lamexp_check_sysmenu_msg(void *message, const unsigned int identifier) +{ + return (((MSG*)message)->message == WM_SYSCOMMAND) && ((((MSG*)message)->wParam & 0xFFF0) == identifier); +} + +/* + * Update system menu entry + */ +bool lamexp_update_sysmenu(const QWidget *win, const unsigned int identifier, const QString &text) +{ + bool ok = false; + + if(HMENU hMenu = ::GetSystemMenu(win->winId(), FALSE)) + { + ok = (ModifyMenu(hMenu, identifier, MF_STRING | MF_BYCOMMAND, identifier, QWCHAR(text)) == TRUE); + } + return ok; +} + +/* + * Display the window's close button + */ +bool lamexp_enable_close_button(const QWidget *win, const bool bEnable) +{ + bool ok = false; + + if(HMENU hMenu = GetSystemMenu(win->winId(), FALSE)) + { + ok = (EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | (bEnable ? MF_ENABLED : MF_GRAYED)) == TRUE); + } + + return ok; +} + +/* + * Check whether ESC key has been pressed since the previous call to this function + */ +bool lamexp_check_escape_state(void) +{ + return (GetAsyncKeyState(VK_ESCAPE) & 0x0001) != 0; +} + +/* + * Set the process priority class for current process + */ +bool lamexp_change_process_priority(const int priority) +{ + return lamexp_change_process_priority(GetCurrentProcess(), priority); +} + +/* + * Set the process priority class for specified process + */ +bool lamexp_change_process_priority(const QProcess *proc, const int priority) +{ + return lamexp_change_process_priority(proc->pid()->hProcess, priority); +} + +/* + * Set the process priority class for specified process + */ +bool lamexp_change_process_priority(void *hProcess, const int priority) +{ + bool ok = false; + + switch(qBound(-2, priority, 2)) + { + case 2: + ok = (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS) == TRUE); + break; + case 1: + if(!(ok = (SetPriorityClass(hProcess, ABOVE_NORMAL_PRIORITY_CLASS) == TRUE))) + { + ok = (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS) == TRUE); + } + break; + case 0: + ok = (SetPriorityClass(hProcess, NORMAL_PRIORITY_CLASS) == TRUE); + break; + case -1: + if(!(ok = (SetPriorityClass(hProcess, BELOW_NORMAL_PRIORITY_CLASS) == TRUE))) + { + ok = (SetPriorityClass(hProcess, IDLE_PRIORITY_CLASS) == TRUE); + } + break; + case -2: + ok = (SetPriorityClass(hProcess, IDLE_PRIORITY_CLASS) == TRUE); + break; + } + + return ok; +} + +/* + * Returns the current file time + */ +unsigned __int64 lamexp_current_file_time(void) +{ + FILETIME fileTime; + GetSystemTimeAsFileTime(&fileTime); + + ULARGE_INTEGER temp; + temp.HighPart = fileTime.dwHighDateTime; + temp.LowPart = fileTime.dwLowDateTime; + + return temp.QuadPart; +} + +/* + * Bring the specifed window to the front + */ +bool lamexp_bring_to_front(const QWidget *win) +{ + const bool ret = (SetForegroundWindow(win->winId()) == TRUE); + SwitchToThisWindow(win->winId(), TRUE); + return ret; +} + +/* + * Bring window of the specifed process to the front (callback) + */ +static BOOL CALLBACK lamexp_bring_process_to_front_helper(HWND hwnd, LPARAM lParam) +{ + DWORD processId = *reinterpret_cast(lParam); + DWORD windowProcessId = NULL; + GetWindowThreadProcessId(hwnd, &windowProcessId); + if(windowProcessId == processId) + { + SwitchToThisWindow(hwnd, TRUE); + SetForegroundWindow(hwnd); + return FALSE; + } + + return TRUE; +} + +/* + * Bring window of the specifed process to the front + */ +bool lamexp_bring_process_to_front(const unsigned long pid) +{ + return EnumWindows(lamexp_bring_process_to_front_helper, reinterpret_cast(&pid)) == TRUE; +} + +/* + * Check the Internet connection status + */ +bool lamexp_get_connection_state(void) +{ + DWORD lpdwFlags = NULL; + BOOL result = InternetGetConnectedState(&lpdwFlags, NULL); + return result == TRUE; +} + +/* + * Retrun the process ID of the given QProcess + */ +unsigned long lamexp_process_id(const QProcess *proc) +{ + PROCESS_INFORMATION *procInf = proc->pid(); + return (procInf) ? procInf->dwProcessId : NULL; +} + +/* + * Convert long path to short path + */ +QString lamexp_path_to_short(const QString &longPath) +{ + QString shortPath; + DWORD buffSize = GetShortPathNameW(reinterpret_cast(longPath.utf16()), NULL, NULL); + + if(buffSize > 0) + { + wchar_t *buffer = new wchar_t[buffSize]; + DWORD result = GetShortPathNameW(reinterpret_cast(longPath.utf16()), buffer, buffSize); + + if(result > 0 && result < buffSize) + { + shortPath = QString::fromUtf16(reinterpret_cast(buffer)); + } + + delete[] buffer; + } + + return (shortPath.isEmpty() ? longPath : shortPath); +} + +/* + * Open media file in external player + */ +bool lamexp_open_media_file(const QString &mediaFilePath) +{ + const static wchar_t *registryPrefix[2] = { L"SOFTWARE\\", L"SOFTWARE\\Wow6432Node\\" }; + const static wchar_t *registryKeys[3] = + { + L"Microsoft\\Windows\\CurrentVersion\\Uninstall\\{97D341C8-B0D1-4E4A-A49A-C30B52F168E9}", + L"Microsoft\\Windows\\CurrentVersion\\Uninstall\\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}", + L"foobar2000" + }; + const static wchar_t *appNames[4] = { L"smplayer_portable.exe", L"smplayer.exe", L"MPUI.exe", L"foobar2000.exe" }; + const static wchar_t *valueNames[2] = { L"InstallLocation", L"InstallDir" }; + + for(size_t i = 0; i < 3; i++) + { + for(size_t j = 0; j < 2; j++) + { + QString mplayerPath; + HKEY registryKeyHandle = NULL; + + const QString currentKey = WCHAR2QSTR(registryPrefix[j]).append(WCHAR2QSTR(registryKeys[i])); + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, QWCHAR(currentKey), 0, KEY_READ, ®istryKeyHandle) == ERROR_SUCCESS) + { + for(size_t k = 0; k < 2; k++) + { + wchar_t Buffer[4096]; + DWORD BuffSize = sizeof(wchar_t*) * 4096; + DWORD DataType = REG_NONE; + if(RegQueryValueExW(registryKeyHandle, valueNames[k], 0, &DataType, reinterpret_cast(Buffer), &BuffSize) == ERROR_SUCCESS) + { + if((DataType == REG_SZ) || (DataType == REG_EXPAND_SZ) || (DataType == REG_LINK)) + { + mplayerPath = WCHAR2QSTR(Buffer); + break; + } + } + } + RegCloseKey(registryKeyHandle); + } + + if(!mplayerPath.isEmpty()) + { + QDir mplayerDir(mplayerPath); + if(mplayerDir.exists()) + { + for(size_t k = 0; k < 4; k++) + { + if(mplayerDir.exists(WCHAR2QSTR(appNames[k]))) + { + qDebug("Player found at:\n%s\n", mplayerDir.absoluteFilePath(WCHAR2QSTR(appNames[k])).toUtf8().constData()); + QProcess::startDetached(mplayerDir.absoluteFilePath(WCHAR2QSTR(appNames[k])), QStringList() << QDir::toNativeSeparators(mediaFilePath)); + return true; + } + } + } + } + } + } + return false; +} + /* * Entry point checks */ diff --git a/src/Global.h b/src/Global.h index d9f04321..aae1b1ff 100644 --- a/src/Global.h +++ b/src/Global.h @@ -39,6 +39,7 @@ class QDate; class QTime; class QIcon; class QWidget; +class QProcess; class LockedFile; enum QtMsgType; @@ -87,6 +88,15 @@ typedef struct } lamexp_os_version_t; +//Beep types +typedef enum +{ + lamexp_beep_info = 0, + lamexp_beep_warning = 1, + lamexp_beep_error = 2 +} +lamexp_beep_t; + //LameXP version info unsigned int lamexp_version_major(void); unsigned int lamexp_version_minor(void); @@ -156,7 +166,30 @@ const QString lamexp_clean_filepath(const QString &str); void lamexp_seed_rand(void); unsigned int lamexp_rand(void); QDate lamexp_current_date_safe(void); +void lamexp_sleep(const unsigned int delay); +bool lamexp_beep(int beepType); +bool lamexp_play_sound(const unsigned short uiSoundIdx, const bool bAsync, const wchar_t *alias = NULL); +bool lamexp_play_sound_file(const QString &library, const unsigned short uiSoundIdx, const bool bAsync); +bool lamexp_exec_shell(const QWidget *win, const QString &url, const bool explore = false); +bool lamexp_exec_shell(const QWidget *win, const QString &url, const QString ¶meters, const QString &directory, const bool explore = false); +__int64 lamexp_perfcounter_frequ(void); +__int64 lamexp_perfcounter_value(void); +bool lamexp_append_sysmenu(const QWidget *win, const unsigned int identifier, const QString &text); +bool lamexp_update_sysmenu(const QWidget *win, const unsigned int identifier, const QString &text); +bool lamexp_check_sysmenu_msg(void *message, const unsigned int identifier); +bool lamexp_enable_close_button(const QWidget *win, const bool bEnable = true); +bool lamexp_check_escape_state(void); +bool lamexp_change_process_priority(const int priority); +bool lamexp_change_process_priority(const QProcess *proc, const int priority); +bool lamexp_change_process_priority(void *hProcess, const int priority); +bool lamexp_bring_to_front(const QWidget *win); +bool lamexp_bring_process_to_front(const unsigned long pid); +bool lamexp_get_connection_state(void); +unsigned long lamexp_process_id(const QProcess *proc); +unsigned __int64 lamexp_current_file_time(void); void lamexp_natural_string_sort(QStringList &list, const bool bIgnoreCase); +bool lamexp_open_media_file(const QString &mediaFilePath); +QString lamexp_path_to_short(const QString &longPath); void lamexp_fatal_exit(const wchar_t* exitMessage, const wchar_t* errorBoxMessage = NULL); //Debug-only functions diff --git a/src/JobObject.cpp b/src/JobObject.cpp new file mode 100644 index 00000000..1a774d21 --- /dev/null +++ b/src/JobObject.cpp @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////////////////////////////// +// LameXP - Audio Encoder Front-End +// Copyright (C) 2004-2013 LoRd_MuldeR +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// http://www.gnu.org/licenses/gpl-2.0.txt +/////////////////////////////////////////////////////////////////////////////// + +#include "JobObject.h" + +#include "Global.h" + +#include + +//Windows includes +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include + +JobObject::JobObject(void) +: + m_hJobObject(NULL) +{ + HANDLE jobObject = CreateJobObject(NULL, NULL); + if((jobObject != NULL) && (jobObject != INVALID_HANDLE_VALUE)) + { + JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobExtendedLimitInfo; + memset(&jobExtendedLimitInfo, 0, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)); + memset(&jobExtendedLimitInfo.BasicLimitInformation, 0, sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION)); + jobExtendedLimitInfo.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION; + if(SetInformationJobObject(jobObject, JobObjectExtendedLimitInformation, &jobExtendedLimitInfo, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION))) + { + m_hJobObject = jobObject; + } + else + { + qWarning("Failed to set job object information!"); + CloseHandle(jobObject); + } + } + else + { + qWarning("Failed to create the job object!"); + } +} + +JobObject::~JobObject(void) +{ + if(m_hJobObject) + { + CloseHandle(m_hJobObject); + m_hJobObject = NULL; + } +} + +bool JobObject::addProcessToJob(const QProcess *proc) +{ + if(m_hJobObject) + { + if(AssignProcessToJobObject(m_hJobObject, proc->pid()->hProcess)) + { + return true; + } + else + { + qWarning("Failed to assign process to job object!"); + return false; + } + } + else + { + qWarning("Cannot assign process to job: No job bject available!"); + return false; + } +} diff --git a/src/JobObject.h b/src/JobObject.h new file mode 100644 index 00000000..d51c3774 --- /dev/null +++ b/src/JobObject.h @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////// +// LameXP - Audio Encoder Front-End +// Copyright (C) 2004-2013 LoRd_MuldeR +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// http://www.gnu.org/licenses/gpl-2.0.txt +/////////////////////////////////////////////////////////////////////////////// + +#pragma once + +class QProcess; + +class JobObject +{ +public: + JobObject(void); + ~JobObject(void); + + bool addProcessToJob(const QProcess *proc); + +private: + void *m_hJobObject; +}; diff --git a/src/Main.cpp b/src/Main.cpp index 4e92a620..f7cf174a 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -44,6 +44,9 @@ #define WIN32_LEAN_AND_MEAN #include +//Forward declaration +LONG WINAPI lamexp_exception_handler(__in struct _EXCEPTION_POINTERS *ExceptionInfo); + /////////////////////////////////////////////////////////////////////////////// // Main function /////////////////////////////////////////////////////////////////////////////// @@ -221,8 +224,6 @@ static int lamexp_main(int argc, char* argv[]) // Applicaton entry point /////////////////////////////////////////////////////////////////////////////// -LONG WINAPI lamexp_exception_handler(__in struct _EXCEPTION_POINTERS *ExceptionInfo); - static int _main(int argc, char* argv[]) { if(LAMEXP_DEBUG) diff --git a/src/Model_CueSheet.cpp b/src/Model_CueSheet.cpp index ee204ff0..d8039d46 100644 --- a/src/Model_CueSheet.cpp +++ b/src/Model_CueSheet.cpp @@ -31,11 +31,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include - #include #include @@ -609,7 +604,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic if(application) { application->processEvents(); - if(lines < 128) Sleep(10); + if(lines < 128) lamexp_sleep(10); } if(cueStream.atEnd()) @@ -833,7 +828,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic if(application) { application->processEvents(); - Sleep(10); + lamexp_sleep(10); } CueSheetFile *currentFile = m_files.at(i); @@ -866,7 +861,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic if(application) { application->processEvents(); - Sleep(10); + lamexp_sleep(10); } CueSheetFile *currentFile = m_files.at(i); int nTracks = currentFile->trackCount(); diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index ada5a767..2a65b519 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -39,11 +39,6 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include - //////////////////////////////////////////////////////////// // SettingsCache Class //////////////////////////////////////////////////////////// @@ -540,7 +535,7 @@ QString SettingsModel::initDirectory(const QString &path) const for(int i = 0; i < 32; i++) { if(QDir(path).mkpath(".")) break; - Sleep(1); + lamexp_sleep(1); } } diff --git a/src/Thread_MessageHandler.cpp b/src/Thread_MessageHandler.cpp index 3f0e8d3d..05444f44 100644 --- a/src/Thread_MessageHandler.cpp +++ b/src/Thread_MessageHandler.cpp @@ -29,11 +29,6 @@ #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include - //////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////// @@ -74,7 +69,7 @@ void MessageHandlerThread::run() case 666: if(!_stricmp(m_parameter, "Force!")) { - ExitProcess(-2); + _exit(-2); } else { diff --git a/src/Tool_Abstract.cpp b/src/Tool_Abstract.cpp index bc6748c2..1c4d3738 100644 --- a/src/Tool_Abstract.cpp +++ b/src/Tool_Abstract.cpp @@ -22,6 +22,7 @@ #include "Tool_Abstract.h" #include "Global.h" +#include "JobObject.h" #include #include @@ -30,23 +31,18 @@ #include #include -//Windows includes -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include - /* * Static vars */ quint64 AbstractTool::s_lastLaunchTime = 0ui64; QMutex AbstractTool::s_mutex_startProcess; -HANDLE AbstractTool::s_handle_jobObject = NULL; +JobObject *AbstractTool::s_jobObject = NULL; unsigned int AbstractTool::s_jobObjRefCount = 0U; /* * Const */ -static const DWORD START_DELAY = 333; //in milliseconds +static const unsigned int START_DELAY = 333; //in milliseconds static const quint64 START_DELAY_NANO = START_DELAY * 1000 * 10; //in 100-nanosecond intervals /* @@ -58,28 +54,8 @@ AbstractTool::AbstractTool(void) if(s_jobObjRefCount < 1U) { - HANDLE jobObject = CreateJobObject(NULL, NULL); - if((jobObject != NULL) && (jobObject != INVALID_HANDLE_VALUE)) - { - JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobExtendedLimitInfo; - memset(&jobExtendedLimitInfo, 0, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)); - memset(&jobExtendedLimitInfo.BasicLimitInformation, 0, sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION)); - jobExtendedLimitInfo.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION; - if(SetInformationJobObject(jobObject, JobObjectExtendedLimitInformation, &jobExtendedLimitInfo, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION))) - { - s_handle_jobObject = jobObject; - s_jobObjRefCount = 1U; - } - else - { - qWarning("Failed to set job object information!"); - CloseHandle(jobObject); - } - } - else - { - qWarning("Failed to create the job object!"); - } + s_jobObject = new JobObject(); + s_jobObjRefCount = 1U; } else { @@ -99,10 +75,9 @@ AbstractTool::~AbstractTool(void) if(s_jobObjRefCount >= 1U) { s_jobObjRefCount--; - if((s_jobObjRefCount < 1U) && s_handle_jobObject) + if(s_jobObjRefCount < 1U) { - CloseHandle(s_handle_jobObject); - s_handle_jobObject = NULL; + LAMEXP_DELETE(s_jobObject); } } } @@ -114,9 +89,9 @@ bool AbstractTool::startProcess(QProcess &process, const QString &program, const { QMutexLocker lock(&s_mutex_startProcess); - if(currentTime() <= s_lastLaunchTime) + if(lamexp_current_file_time() <= s_lastLaunchTime) { - Sleep(START_DELAY); + lamexp_sleep(START_DELAY); } emit messageLogged(commandline2string(program, args) + "\n"); @@ -133,18 +108,15 @@ bool AbstractTool::startProcess(QProcess &process, const QString &program, const if(process.waitForStarted()) { - if(s_handle_jobObject) + if(s_jobObject) { - if(!AssignProcessToJobObject(s_handle_jobObject, process.pid()->hProcess)) + if(!s_jobObject->addProcessToJob(&process)) { qWarning("Failed to assign process to job object!"); } } - if(!SetPriorityClass(process.pid()->hProcess, BELOW_NORMAL_PRIORITY_CLASS)) - { - SetPriorityClass(process.pid()->hProcess, IDLE_PRIORITY_CLASS); - } - + + lamexp_change_process_priority(&process, -1); lock.unlock(); if(m_firstLaunch) @@ -153,7 +125,7 @@ bool AbstractTool::startProcess(QProcess &process, const QString &program, const m_firstLaunch = false; } - s_lastLaunchTime = currentTime() + START_DELAY_NANO; + s_lastLaunchTime = lamexp_current_file_time() + START_DELAY_NANO; return true; } @@ -164,7 +136,7 @@ bool AbstractTool::startProcess(QProcess &process, const QString &program, const process.kill(); process.waitForFinished(-1); - s_lastLaunchTime = currentTime() + START_DELAY_NANO; + s_lastLaunchTime = lamexp_current_file_time() + START_DELAY_NANO; return false; } @@ -183,38 +155,4 @@ QString AbstractTool::commandline2string(const QString &program, const QStringLi return commandline; } -/* - * Convert long path to short path - */ -QString AbstractTool::pathToShort(const QString &longPath) -{ - QString shortPath; - DWORD buffSize = GetShortPathNameW(reinterpret_cast(longPath.utf16()), NULL, NULL); - - if(buffSize > 0) - { - wchar_t *buffer = new wchar_t[buffSize]; - DWORD result = GetShortPathNameW(reinterpret_cast(longPath.utf16()), buffer, buffSize); - if(result > 0 && result < buffSize) - { - shortPath = QString::fromUtf16(reinterpret_cast(buffer)); - } - - delete[] buffer; - } - - return (shortPath.isEmpty() ? longPath : shortPath); -} - -const quint64 AbstractTool::currentTime(void) -{ - FILETIME fileTime; - GetSystemTimeAsFileTime(&fileTime); - - ULARGE_INTEGER temp; - temp.HighPart = fileTime.dwHighDateTime; - temp.LowPart = fileTime.dwLowDateTime; - - return temp.QuadPart; -} diff --git a/src/Tool_Abstract.h b/src/Tool_Abstract.h index b4201541..5d29c9a0 100644 --- a/src/Tool_Abstract.h +++ b/src/Tool_Abstract.h @@ -25,6 +25,7 @@ class QMutex; class QProcess; +class JobObject; class AbstractTool : public QObject { @@ -36,8 +37,6 @@ public: bool startProcess(QProcess &process, const QString &program, const QStringList &args); static QString commandline2string(const QString &program, const QStringList &arguments); - static QString AbstractTool::pathToShort(const QString &longPath); - static inline const quint64 currentTime(void); signals: void statusUpdated(int progress); @@ -50,7 +49,7 @@ private: static quint64 s_lastLaunchTime; static QMutex s_mutex_startProcess; static unsigned int s_jobObjRefCount; - static void *s_handle_jobObject; + static JobObject *s_jobObject; bool m_firstLaunch; };