Initial commit — M3U playlist tool with MP3/AAC encoding

This commit is contained in:
2026-05-10 03:02:53 +00:00
commit b14531362b
114 changed files with 14184 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Threading;
namespace Win32
{
internal class HiPerfTimer
{
private readonly long freq;
private long startTime, stopTime;
// Constructor
public HiPerfTimer()
{
startTime = 0;
stopTime = 0;
if (QueryPerformanceFrequency(out freq) == false)
{
// high-performance counter not supported
throw new Win32Exception();
}
}
public double Duration
{
get { return (stopTime - startTime)/(double) freq; }
}
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceCounter(
out long lpPerformanceCount);
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceFrequency(
out long lpFrequency);
// Start the timer
public void Start()
{
// lets do the waiting threads there work
Thread.Sleep(0);
QueryPerformanceCounter(out startTime);
}
// Stop the timer
public void Stop()
{
QueryPerformanceCounter(out stopTime);
}
// Returns the duration of the timer (in seconds)
}
}