Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8e48c7b
ninja fix (hostname/fullname got mixed up)
Jan 28, 2011
a60cd21
...
Feb 7, 2011
f35eed2
fix up merge
Feb 7, 2011
014ada6
replace callback with SynchronizationContext
Feb 14, 2011
c3a3561
add standard DCC support
Feb 15, 2011
d96fc31
fix potential UTF-8 decoding bug (where multibyte chars are split bet…
Feb 15, 2011
ff2a888
complete DCC chat support
Feb 16, 2011
3139dfe
complete DCC chat support
Feb 16, 2011
6d977a7
add channel list page
Feb 17, 2011
35e94df
upgraded ignore functionality
Feb 17, 2011
d04e4bc
add support for alt+N tab switching
Feb 17, 2011
464bf67
progress on audio
Feb 18, 2011
20d3829
basic support for sounds
Feb 20, 2011
105da0a
add tooltips to sound settings
Feb 20, 2011
cfeaeec
get rid of data binding errors
Feb 20, 2011
531833d
directshow interfaces
Feb 20, 2011
aae237e
add SOCKS5 proxy support
Feb 20, 2011
bc693c6
fix tab order in settings dialog
Feb 20, 2011
230b2a4
updates to directshow code
Feb 21, 2011
2ff69a5
new audio project
Feb 27, 2011
bcf8334
backup audio changes
Feb 28, 2011
d77d8d8
more audio work
Mar 1, 2011
4b3a83d
more work on audio buffers
Mar 1, 2011
4cd490a
completed GSM encoding/decoding
Mar 2, 2011
b769356
support for the STUN protocol
Mar 3, 2011
1662009
add RTP protocol
Mar 4, 2011
33bc9a9
add basic fixed jitter buffer
Mar 5, 2011
f15cd68
add config options for voice
Mar 6, 2011
7916588
add voice chat settings
Mar 7, 2011
52f9061
delete accidental zip file
Mar 8, 2011
338b246
refactor nickname list to add more visual options
Mar 8, 2011
49693cb
refactor nickname list to add more visual options
Mar 8, 2011
d783fb4
more work on voice chat
Mar 11, 2011
d52cadc
add wav and mp3 playing support
Mar 13, 2011
f1cac21
snapshot
Mar 18, 2011
655e101
refactor audio to support windows XP
Mar 19, 2011
8553b4a
working on the jitter buffer
Mar 20, 2011
335f6eb
fix warnings
Mar 20, 2011
3c2d09f
more changes for XP compatibility
Mar 22, 2011
2ed2fd7
fix crashing bug related to nick changes
Apr 1, 2011
f70e2d2
clean up codecs and buffers
Apr 10, 2011
23c458c
voice chat works!
Apr 14, 2011
70d4aa5
microphone gain support
Apr 14, 2011
395fd4e
bugfix: crash when someone leaves channel during voice chat
Apr 16, 2011
0c8c93a
forgot to check in this work
May 18, 2011
6e82b61
this too
May 18, 2011
68d36fa
1.6 beta
May 26, 2011
11aa314
remove voice chat features
Sep 3, 2011
96b05ed
fix basic .wav file playing
Sep 3, 2011
6629055
prevent crashes when selecting text; allow TcpClient to use ipv6
Jun 7, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Build/Setup.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<Directory Id="ProgramMenuFolder">
<Directory Id="AppProgFolder" Name="Floe IRC Client"/>
</Directory>
<!-- <Merge Id="CRT" Language="0" SourceFile="$(env.VSINSTALLDIR)\..\Common Files\Merge Modules\Microsoft_VC100_CRT_x86.msm" DiskId="1"/> -->
</Directory>

<DirectoryRef Id="APPROOTDIR">
Expand All @@ -54,6 +55,7 @@
<Feature Id="FloeFeature" Level="1" Title="Floe IRC Client">
<ComponentRef Id="Binaries"/>
<ComponentRef Id="AppShortcut"/>
<!--<MergeRef Id="CRT"/>-->
</Feature>

<InstallExecuteSequence>
Expand Down
17 changes: 17 additions & 0 deletions Floe.Audio/Exceptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace Floe.Audio
{
[Serializable]
public class FileFormatException : Exception
{
public FileFormatException()
{
}

public FileFormatException(string message)
: base(message)
{
}
}
}
102 changes: 102 additions & 0 deletions Floe.Audio/FifoStream.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;

namespace Floe.Audio
{
public class FifoStream : Stream
{
private const int BlockSize = 8192;

private LinkedList<byte[]> _blocks;
private int _readIdx, _writeIdx;
private ManualResetEventSlim _pulse;
private bool _isDisposed;

public FifoStream()
{
_blocks = new LinkedList<byte[]>();
_pulse = new ManualResetEventSlim(false);
}

public override bool CanRead { get { return true; } }
public override bool CanSeek { get { return false; } }
public override bool CanWrite { get { return true; } }
public override void Flush() { throw new NotImplementedException(); }
public override long Length { get { throw new NotImplementedException(); } }
public override long Position { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } }
public override long Seek(long offset, SeekOrigin origin) { throw new NotImplementedException(); }
public override void SetLength(long value) { throw new NotImplementedException(); }

public override int Read(byte[] buffer, int offset, int count)
{
_pulse.Wait();
if (_isDisposed)
{
return 0;
}
int total = 0;
lock (_blocks)
{
while (count > 0)
{
int written;
written = Math.Min(count, (_blocks.First == _blocks.Last ? _writeIdx : BlockSize) - _readIdx);
Array.Copy(_blocks.First.Value, _readIdx, buffer, offset, written);
count -= written;
offset += written;
_readIdx += written;

if (_readIdx >= BlockSize)
{
_blocks.RemoveFirst();
_readIdx = 0;
}
total += written;

if (_blocks.First == null ||
(_blocks.First == _blocks.Last && _readIdx >= _writeIdx))
{
_pulse.Reset();
break;
}
}
}
return total;
}

public override void Write(byte[] buffer, int offset, int count)
{
if (count < 1)
{
return;
}

lock (_blocks)
{
while (count > 0)
{
if (_blocks.Last == null || _writeIdx >= BlockSize)
{
_blocks.AddLast(new byte[BlockSize]);
_writeIdx = 0;
}
int written = Math.Min(count, BlockSize - _writeIdx);
Array.Copy(buffer, offset, _blocks.Last.Value, _writeIdx, written);
count -= written;
offset += written;
_writeIdx += written;
_pulse.Set();
}
}
}

public override void Close()
{
base.Close();
_isDisposed = true;
_pulse.Set();
}
}
}
84 changes: 84 additions & 0 deletions Floe.Audio/FilePlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using System.IO;
using System.Linq;
using Floe.Interop;

namespace Floe.Audio
{
public class FilePlayer : IDisposable
{
private const int WavBufferSamples = 3000;
private static readonly byte[] WavFileSignature = { 0x52, 0x49, 0x46, 0x46 }; // RIFF
private static readonly byte[] Mp3FileSignature = { 0x49, 0x44, 0x33 }; // ID3

private WaveOut _waveOut;

public event EventHandler Done;

public FilePlayer(string fileName)
{
var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
var sig = new byte[4];
try
{
fileStream.Read(sig, 0, 4);
fileStream.Seek(0, SeekOrigin.Begin);
if (WavFileSignature.SequenceEqual(sig.Take(WavFileSignature.Length)))
{
var wavStream = new WavFileStream(fileStream);
_waveOut = new WaveOut(wavStream, wavStream.Format, WavBufferSamples * wavStream.Format.FrameSize);
}
else if (Mp3FileSignature.SequenceEqual(sig.Take(Mp3FileSignature.Length)))
{
var mp3Stream = new Mp3FileStream(fileStream);
_waveOut = new WaveOut(mp3Stream, mp3Stream.Format, mp3Stream.Format.BlockSize + 1);
}
else
{
throw new FileFormatException("Unrecognized file format.");
}
}
catch (EndOfStreamException)
{
throw new FileFormatException("Premature end of file.");
}
_waveOut.EndOfStream += (sender, e) =>
{
var handler = this.Done;
if(handler != null)
{
handler(this, EventArgs.Empty);
}
};
}

public void Start()
{
_waveOut.Start();
}

public void Close()
{
_waveOut.Close();
}

public void Dispose()
{
_waveOut.Dispose();
}

public static void PlayAsync(string fileName, Action<object> callback = null, object state = null)
{
var player = new FilePlayer(fileName);
player.Done += (sender, e) =>
{
if (callback != null)
{
callback(state);
}
player.Close();
};
player.Start();
}
}
}
85 changes: 85 additions & 0 deletions Floe.Audio/Floe.Audio.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BDD20714-E82B-45C9-A310-BE57BA986F44}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Floe.Audio</RootNamespace>
<AssemblyName>Floe.Audio</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Floe.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Exceptions.cs" />
<Compile Include="FifoStream.cs" />
<Compile Include="Mp3FileStream.cs" />
<Compile Include="Voice\CodecInfo.cs" />
<Compile Include="WavProcess.cs" />
<Compile Include="WaveInMeter.cs" />
<Compile Include="Voice\Delegates.cs" />
<Compile Include="Voice\JitterBuffer.cs" />
<Compile Include="Voice\VoiceIn.cs" />
<Compile Include="Voice\VoicePacket.cs" />
<Compile Include="Voice\VoicePacketPool.cs" />
<Compile Include="Voice\VoicePeer.cs" />
<Compile Include="Voice\VoiceClient.cs" />
<Compile Include="WavFileStream.cs" />
<Compile Include="FilePlayer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Voice\VoiceLoopback.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Floe.Interop\Floe.Interop.vcxproj">
<Project>{3CEFFCEB-C836-47CC-8B8A-EC5655E1B5B7}</Project>
<Name>Floe.Interop</Name>
</ProjectReference>
<ProjectReference Include="..\Floe.Net\Floe.Net.csproj">
<Project>{1D4AD463-4355-4DA6-B8E6-0E8BB75B50D9}</Project>
<Name>Floe.Net</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading