This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//open a new ID3Stream to the specific file | |
var id3Stream = new ID3Stream(path, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite); | |
//read the ID3Tag through ID3 class (v1 example) | |
var result = (ID3V1Result)ID3.ReadID3Tag(new ID3V1Processor(id3Stream)); | |
Console.WriteLine(result.Title); | |
Console.WriteLine(result.Artist); | |
Console.WriteLine(result.Album); | |
Console.WriteLine(result.Year); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.game; | |
public class Gameloop | |
extends Thread | |
{ | |
public long Wait; | |
public Game Game; | |
private boolean run; | |
public Gameloop(Game g, long Wait) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CSCore; | |
using CSCore.Codecs; | |
using CSCore.Streams; | |
using CSCore.XAudio2; | |
namespace Sharpex2D.Framework.Audio.XAudio2 | |
{ | |
public class XAudio2SoundProvider : ISoundProvider | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public class SerialCode | |
{ | |
public string Code{set; get;} | |
public string GameName{set; get;} | |
public string Description{set; get;} | |
} | |
public SerialCodeProvider | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sends the data. | |
/// </summary> | |
/// <param name="buffer">The Buffer.</param> | |
/// <param name="count">The Count.</param> | |
/// <param name="member">The SessionMember.</param> | |
public void Send(byte[] buffer, int count, SessionMember member) | |
{ | |
var data = new byte[10 + count]; | |
var msg = BitConverter.GetBytes((short) SystemMessage.UserDatagram); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public DataWriter(byte[] buffer) | |
{ | |
if (buffer == null) | |
throw new ArgumentNullException("buffer"); | |
GCHandle handle = GCHandle.Alloc(buffer, WhateverMode.Pinned); | |
_buffer = (byte*)handle.AddrOfPinnedObject(); | |
} | |
public void Write(int value) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//send join request to server and wait for response. | |
//the initial join should be blocking since if we fail to connect we should not listing for packets | |
var joinRequest = new byte[2]; | |
joinRequest = BitConverter.GetBytes((short) SystemMessage.Join); | |
_udpService.Send(joinRequest, joinRequest.Length, _joinedSessionEndPoint); | |
int timeOut = 1000; | |
//we should give the server some time to respond. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2012-2015 Sharpex2D - Kevin Scholz (ThuCommix) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the 'Software'), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2012-2015 Sharpex2D - Kevin Scholz (ThuCommix) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the 'Software'), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ReadHeader() | |
{ | |
var reader = new BinaryReader(_stream); | |
if (ReadChunk(reader) != "RIFF") | |
{ | |
throw new Exception("Invalid file format."); | |
} | |
reader.ReadInt32(); |
OlderNewer