diff --git a/CdgLib/CDGFile.cs b/CdgLib/CDGFile.cs index 71ba040..e38217d 100644 --- a/CdgLib/CDGFile.cs +++ b/CdgLib/CDGFile.cs @@ -2,103 +2,100 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; +using System.Xml.Schema; namespace CdgLib { - public class CDGFile : IDisposable + public class CdgFile : IDisposable { - private const int COLOUR_TABLE_SIZE = 16; + private const int ColourTableSize = 16; // To detect redundant calls - private bool disposedValue; + private bool _disposedValue; - #region " IDisposable Support " - - // This code added by Visual Basic to correctly implement the disposable pattern. public void Dispose() { - // Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. + Dispose(true); GC.SuppressFinalize(this); } - #endregion - + // IDisposable protected virtual void Dispose(bool disposing) { - if (!disposedValue) + if (!_disposedValue) { if (disposing) { - m_pStream.Close(); + _mPStream.Close(); } - m_pStream = null; - m_pSurface = null; + _mPStream = null; + _mPSurface = null; } - disposedValue = true; + _disposedValue = true; } #region "Constants" //CDG Command Code - private const byte CDG_COMMAND = 0x9; + private const byte CdgCommand = 0x9; //CDG Instruction Codes - private const int CDG_INST_MEMORY_PRESET = 1; - private const int CDG_INST_BORDER_PRESET = 2; - private const int CDG_INST_TILE_BLOCK = 6; - private const int CDG_INST_SCROLL_PRESET = 20; - private const int CDG_INST_SCROLL_COPY = 24; - private const int CDG_INST_DEF_TRANSP_COL = 28; - private const int CDG_INST_LOAD_COL_TBL_LO = 30; - private const int CDG_INST_LOAD_COL_TBL_HIGH = 31; + private const int CdgInstMemoryPreset = 1; + private const int CdgInstBorderPreset = 2; + private const int CdgInstTileBlock = 6; + private const int CdgInstScrollPreset = 20; + private const int CdgInstScrollCopy = 24; + private const int CdgInstDefTranspCol = 28; + private const int CdgInstLoadColTblLo = 30; + private const int CdgInstLoadColTblHigh = 31; - private const int CDG_INST_TILE_BLOCK_XOR = 38; + private const int CdgInstTileBlockXor = 38; //Bitmask for all CDG fields - private const byte CDG_MASK = 0x3f; - private const int CDG_PACKET_SIZE = 24; - private const int TILE_HEIGHT = 12; + private const byte CdgMask = 0x3f; + private const int CdgPacketSize = 24; + private const int TileHeight = 12; - private const int TILE_WIDTH = 6; + private const int TileWidth = 6; //This is the size of the display as defined by the CDG specification. //The pixels in this region can be painted, and scrolling operations //rotate through this number of pixels. - public const int CDG_FULL_WIDTH = 300; + public const int CdgFullWidth = 300; - public const int CDG_FULL_HEIGHT = 216; + public const int CdgFullHeight = 216; //This is the size of the screen that is actually intended to be //visible. It is the center area of CDG_FULL. - private const int CDG_DISPLAY_WIDTH = 294; + private const int CdgDisplayWidth = 294; - private const int CDG_DISPLAY_HEIGHT = 204; + private const int CdgDisplayHeight = 204; #endregion #region "Private Declarations" - private readonly byte[,] m_pixelColours = new byte[CDG_FULL_HEIGHT, CDG_FULL_WIDTH]; - private readonly int[] m_colourTable = new int[COLOUR_TABLE_SIZE]; - private int m_presetColourIndex; - private int m_borderColourIndex; + private readonly byte[,] _mPixelColours = new byte[CdgFullHeight, CdgFullWidth]; + private readonly int[] _mColourTable = new int[ColourTableSize]; + private int _mPresetColourIndex; + private int _mBorderColourIndex; - private int m_transparentColour; - private int m_hOffset; + private int _mTransparentColour; + private int _mHOffset; - private int m_vOffset; - private CdgFileIoStream m_pStream; - private ISurface m_pSurface; - private long m_positionMs; + private int _mVOffset; + private CdgFileIoStream _mPStream; + private Surface _mPSurface; + private long _mPositionMs; - private long m_duration; + private long _mDuration; - private Bitmap mImage; + private Bitmap _mImage; #endregion #region "Properties" - public bool Transparent { get; set; } + public bool Transparent => true; public Image RgbImage { @@ -108,13 +105,13 @@ namespace CdgLib try { var i = 0; - for (var ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (var ri = 0; ri <= CdgFullHeight - 1; ri++) { - for (var ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (var ci = 0; ci <= CdgFullWidth - 1; ci++) { - var ARGBInt = m_pSurface.rgbData[ri, ci]; + var argbInt = _mPSurface.RgbData[ri, ci]; var myByte = new byte[4]; - myByte = BitConverter.GetBytes(ARGBInt); + myByte = BitConverter.GetBytes(argbInt); temp.Write(myByte, 0, 4); } } @@ -123,7 +120,7 @@ namespace CdgLib { //Do nothing (empty bitmap will be returned) } - var myBitmap = GraphicUtil.StreamToBitmap(ref temp, CDG_FULL_WIDTH, CDG_FULL_HEIGHT); + var myBitmap = GraphicUtil.StreamToBitmap(ref temp, CdgFullWidth, CdgFullHeight); if (Transparent) { myBitmap.MakeTransparent(myBitmap.GetPixel(1, 1)); @@ -143,59 +140,59 @@ namespace CdgLib } //New - public CDGFile(string cdgFileName) + public CdgFile(string cdgFileName) { - m_pStream = new CdgFileIoStream(); - m_pStream.Open(cdgFileName); - m_pSurface = new ISurface(); - if (m_pStream != null && m_pSurface != null) + _mPStream = new CdgFileIoStream(); + _mPStream.Open(cdgFileName); + _mPSurface = new Surface(); + if (_mPStream != null && _mPSurface != null) { - reset(); - m_duration = m_pStream.Getsize() / CDG_PACKET_SIZE * 1000 / 300; + Reset(); + _mDuration = _mPStream.Getsize()/CdgPacketSize*1000/300; } } - public long getTotalDuration() + public long GetTotalDuration() { - return m_duration; + return _mDuration; } - public bool renderAtPosition(long ms) + public bool RenderAtPosition(long ms) { var pack = new CdgPacket(); long numPacks = 0; var res = true; - if (m_pStream == null) + if (_mPStream == null) { return false; } - if (ms < m_positionMs) + if (ms < _mPositionMs) { - if (m_pStream.Seek(0, SeekOrigin.Begin) < 0) + if (_mPStream.Seek(0, SeekOrigin.Begin) < 0) return false; - m_positionMs = 0; + _mPositionMs = 0; } //duration of one packet is 1/300 seconds (4 packets per sector, 75 sectors per second) - numPacks = ms - m_positionMs; + numPacks = ms - _mPositionMs; numPacks /= 10; - m_positionMs += numPacks * 10; + _mPositionMs += numPacks*10; numPacks *= 3; //TODO: double check logic due to inline while loop fucntionality //AndAlso m_pSurface.rgbData Is Nothing while (numPacks > 0) { - res = readPacket(ref pack); - processPacket(ref pack); + res = ReadPacket(ref pack); + ProcessPacket(ref pack); numPacks -= 1; } - render(); + Render(); return res; } @@ -203,97 +200,97 @@ namespace CdgLib #region "Private Methods" - private void reset() + private void Reset() { - Array.Clear(m_pixelColours, 0, m_pixelColours.Length); - Array.Clear(m_colourTable, 0, m_colourTable.Length); + Array.Clear(_mPixelColours, 0, _mPixelColours.Length); + Array.Clear(_mColourTable, 0, _mColourTable.Length); - m_presetColourIndex = 0; - m_borderColourIndex = 0; - m_transparentColour = 0; - m_hOffset = 0; - m_vOffset = 0; + _mPresetColourIndex = 0; + _mBorderColourIndex = 0; + _mTransparentColour = 0; + _mHOffset = 0; + _mVOffset = 0; - m_duration = 0; - m_positionMs = 0; + _mDuration = 0; + _mPositionMs = 0; //clear surface - if (m_pSurface.rgbData != null) + if (_mPSurface.RgbData != null) { - Array.Clear(m_pSurface.rgbData, 0, m_pSurface.rgbData.Length); + Array.Clear(_mPSurface.RgbData, 0, _mPSurface.RgbData.Length); } } - private bool readPacket(ref CdgPacket pack) + private bool ReadPacket(ref CdgPacket pack) { - if (m_pStream == null || m_pStream.Eof()) + if (_mPStream == null || _mPStream.Eof()) { return false; } var read = 0; - read += m_pStream.Read(ref pack.command, 1); - read += m_pStream.Read(ref pack.instruction, 1); - read += m_pStream.Read(ref pack.parityQ, 2); - read += m_pStream.Read(ref pack.data, 16); - read += m_pStream.Read(ref pack.parityP, 4); + read += _mPStream.Read(ref pack.Command, 1); + read += _mPStream.Read(ref pack.Instruction, 1); + read += _mPStream.Read(ref pack.ParityQ, 2); + read += _mPStream.Read(ref pack.Data, 16); + read += _mPStream.Read(ref pack.ParityP, 4); return read == 24; } - private void processPacket(ref CdgPacket pack) + private void ProcessPacket(ref CdgPacket pack) { - var inst_code = 0; + var instCode = 0; - if ((pack.command[0] & CDG_MASK) == CDG_COMMAND) + if ((pack.Command[0] & CdgMask) == CdgCommand) { - inst_code = pack.instruction[0] & CDG_MASK; - switch (inst_code) + instCode = pack.Instruction[0] & CdgMask; + switch (instCode) { - case CDG_INST_MEMORY_PRESET: - memoryPreset(ref pack); + case CdgInstMemoryPreset: + MemoryPreset(ref pack); break; - case CDG_INST_BORDER_PRESET: - borderPreset(ref pack); + case CdgInstBorderPreset: + BorderPreset(ref pack); break; - case CDG_INST_TILE_BLOCK: - tileBlock(ref pack, false); + case CdgInstTileBlock: + TileBlock(ref pack, false); break; - case CDG_INST_SCROLL_PRESET: - scroll(ref pack, false); + case CdgInstScrollPreset: + Scroll(ref pack, false); break; - case CDG_INST_SCROLL_COPY: - scroll(ref pack, true); + case CdgInstScrollCopy: + Scroll(ref pack, true); break; - case CDG_INST_DEF_TRANSP_COL: - defineTransparentColour(ref pack); + case CdgInstDefTranspCol: + DefineTransparentColour(ref pack); break; - case CDG_INST_LOAD_COL_TBL_LO: - loadColorTable(ref pack, 0); + case CdgInstLoadColTblLo: + LoadColorTable(ref pack, 0); break; - case CDG_INST_LOAD_COL_TBL_HIGH: - loadColorTable(ref pack, 1); + case CdgInstLoadColTblHigh: + LoadColorTable(ref pack, 1); break; - case CDG_INST_TILE_BLOCK_XOR: - tileBlock(ref pack, true); + case CdgInstTileBlockXor: + TileBlock(ref pack, true); break; @@ -306,20 +303,20 @@ namespace CdgLib } - private void memoryPreset(ref CdgPacket pack) + private void MemoryPreset(ref CdgPacket pack) { var colour = 0; var ri = 0; var ci = 0; var repeat = 0; - colour = pack.data[0] & 0xf; - repeat = pack.data[1] & 0xf; + colour = pack.Data[0] & 0xf; + repeat = pack.Data[1] & 0xf; //Our new interpretation of CD+G Revealed is that memory preset //commands should also change the border - m_presetColourIndex = colour; - m_borderColourIndex = colour; + _mPresetColourIndex = colour; + _mBorderColourIndex = colour; //we have a reliable data stream, so the repeat command //is executed only the first time @@ -335,59 +332,59 @@ namespace CdgLib //Set the preset colour for every pixel. Must be stored in //the pixel colour table indeces array - for (ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = 0; ri <= CdgFullHeight - 1; ri++) { - for (ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = 0; ci <= CdgFullWidth - 1; ci++) { - m_pixelColours[ri, ci] = (byte)colour; + _mPixelColours[ri, ci] = (byte) colour; } } } } - private void borderPreset(ref CdgPacket pack) + private void BorderPreset(ref CdgPacket pack) { var colour = 0; var ri = 0; var ci = 0; - colour = pack.data[0] & 0xf; - m_borderColourIndex = colour; + colour = pack.Data[0] & 0xf; + _mBorderColourIndex = colour; //The border area is the area contained with a rectangle //defined by (0,0,300,216) minus the interior pixels which are contained //within a rectangle defined by (6,12,294,204). - for (ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = 0; ri <= CdgFullHeight - 1; ri++) { for (ci = 0; ci <= 5; ci++) { - m_pixelColours[ri, ci] = (byte)colour; + _mPixelColours[ri, ci] = (byte) colour; } - for (ci = CDG_FULL_WIDTH - 6; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = CdgFullWidth - 6; ci <= CdgFullWidth - 1; ci++) { - m_pixelColours[ri, ci] = (byte)colour; + _mPixelColours[ri, ci] = (byte) colour; } } - for (ci = 6; ci <= CDG_FULL_WIDTH - 7; ci++) + for (ci = 6; ci <= CdgFullWidth - 7; ci++) { for (ri = 0; ri <= 11; ri++) { - m_pixelColours[ri, ci] = (byte)colour; + _mPixelColours[ri, ci] = (byte) colour; } - for (ri = CDG_FULL_HEIGHT - 12; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = CdgFullHeight - 12; ri <= CdgFullHeight - 1; ri++) { - m_pixelColours[ri, ci] = (byte)colour; + _mPixelColours[ri, ci] = (byte) colour; } } } - private void loadColorTable(ref CdgPacket pack, int table) + private void LoadColorTable(ref CdgPacket pack, int table) { for (var i = 0; i <= 7; i++) { @@ -395,8 +392,8 @@ namespace CdgLib //7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 //X X r r r r g g X X g g b b b b - var byte0 = pack.data[2 * i]; - var byte1 = pack.data[2 * i + 1]; + var byte0 = pack.Data[2*i]; + var byte1 = pack.Data[2*i + 1]; var red = (byte0 & 0x3f) >> 2; var green = ((byte0 & 0x3) << 2) | ((byte1 & 0x3f) >> 4); var blue = byte1 & 0xf; @@ -405,34 +402,34 @@ namespace CdgLib green *= 17; blue *= 17; - if (m_pSurface != null) + if (_mPSurface != null) { - m_colourTable[i + table * 8] = m_pSurface.MapRGBColour(red, green, blue); + _mColourTable[i + table*8] = _mPSurface.MapRgbColour(red, green, blue); } } } - private void tileBlock(ref CdgPacket pack, bool bXor) + private void TileBlock(ref CdgPacket pack, bool bXor) { var colour0 = 0; var colour1 = 0; - var column_index = 0; - var row_index = 0; + var columnIndex = 0; + var rowIndex = 0; var myByte = 0; var pixel = 0; - var xor_col = 0; + var xorCol = 0; var currentColourIndex = 0; - var new_col = 0; + var newCol = 0; - colour0 = pack.data[0] & 0xf; - colour1 = pack.data[1] & 0xf; - row_index = (pack.data[2] & 0x1f) * 12; - column_index = (pack.data[3] & 0x3f) * 6; + colour0 = pack.Data[0] & 0xf; + colour1 = pack.Data[1] & 0xf; + rowIndex = (pack.Data[2] & 0x1f)*12; + columnIndex = (pack.Data[3] & 0x3f)*6; - if (row_index > CDG_FULL_HEIGHT - TILE_HEIGHT) + if (rowIndex > CdgFullHeight - TileHeight) return; - if (column_index > CDG_FULL_WIDTH - TILE_WIDTH) + if (columnIndex > CdgFullWidth - TileWidth) return; //Set the pixel array for each of the pixels in the 12x6 tile. @@ -443,7 +440,7 @@ namespace CdgLib for (var i = 0; i <= 11; i++) { - myByte = pack.data[4 + i] & 0x3f; + myByte = pack.Data[4 + i] & 0x3f; for (var j = 0; j <= 5; j++) { pixel = (myByte >> (5 - j)) & 0x1; @@ -452,44 +449,44 @@ namespace CdgLib //Tile Block XOR if (pixel == 0) { - xor_col = colour0; + xorCol = colour0; } else { - xor_col = colour1; + xorCol = colour1; } //Get the colour index currently at this location, and xor with it - currentColourIndex = m_pixelColours[row_index + i, column_index + j]; - new_col = currentColourIndex ^ xor_col; + currentColourIndex = _mPixelColours[rowIndex + i, columnIndex + j]; + newCol = currentColourIndex ^ xorCol; } else { if (pixel == 0) { - new_col = colour0; + newCol = colour0; } else { - new_col = colour1; + newCol = colour1; } } //Set the pixel with the new colour. We set both the surfarray //containing actual RGB values, as well as our array containing //the colour indexes into our colour table. - m_pixelColours[row_index + i, column_index + j] = (byte)new_col; + _mPixelColours[rowIndex + i, columnIndex + j] = (byte) newCol; } } } - private void defineTransparentColour(ref CdgPacket pack) + private void DefineTransparentColour(ref CdgPacket pack) { - m_transparentColour = pack.data[0] & 0xf; + _mTransparentColour = pack.Data[0] & 0xf; } - private void scroll(ref CdgPacket pack, bool copy) + private void Scroll(ref CdgPacket pack, bool copy) { var colour = 0; var hScroll = 0; @@ -502,9 +499,9 @@ namespace CdgLib var hScrollPixels = 0; //Decode the scroll command parameters - colour = pack.data[0] & 0xf; - hScroll = pack.data[1] & 0x3f; - vScroll = pack.data[2] & 0x3f; + colour = pack.Data[0] & 0xf; + hScroll = pack.Data[1] & 0x3f; + vScroll = pack.Data[2] & 0x3f; hSCmd = (hScroll & 0x30) >> 4; hOffset = hScroll & 0x7; @@ -512,8 +509,8 @@ namespace CdgLib vOffset = vScroll & 0xf; - m_hOffset = hOffset < 5 ? hOffset : 5; - m_vOffset = vOffset < 11 ? vOffset : 11; + _mHOffset = hOffset < 5 ? hOffset : 5; + _mVOffset = vOffset < 11 ? vOffset : 11; //Scroll Vertical - Calculate number of pixels @@ -546,19 +543,19 @@ namespace CdgLib //Perform the actual scroll. - var temp = new byte[CDG_FULL_HEIGHT + 1, CDG_FULL_WIDTH + 1]; - var vInc = vScrollPixels + CDG_FULL_HEIGHT; - var hInc = hScrollPixels + CDG_FULL_WIDTH; + var temp = new byte[CdgFullHeight + 1, CdgFullWidth + 1]; + var vInc = vScrollPixels + CdgFullHeight; + var hInc = hScrollPixels + CdgFullWidth; var ri = 0; //row index var ci = 0; //column index - for (ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = 0; ri <= CdgFullHeight - 1; ri++) { - for (ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = 0; ci <= CdgFullWidth - 1; ci++) { - temp[(ri + vInc) % CDG_FULL_HEIGHT, (ci + hInc) % CDG_FULL_WIDTH] = m_pixelColours[ri, ci]; + temp[(ri + vInc)%CdgFullHeight, (ci + hInc)%CdgFullWidth] = _mPixelColours[ri, ci]; } } @@ -571,21 +568,21 @@ namespace CdgLib { if (vScrollPixels > 0) { - for (ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = 0; ci <= CdgFullWidth - 1; ci++) { for (ri = 0; ri <= vScrollPixels - 1; ri++) { - temp[ri, ci] = (byte)colour; + temp[ri, ci] = (byte) colour; } } } else if (vScrollPixels < 0) { - for (ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = 0; ci <= CdgFullWidth - 1; ci++) { - for (ri = CDG_FULL_HEIGHT + vScrollPixels; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = CdgFullHeight + vScrollPixels; ri <= CdgFullHeight - 1; ri++) { - temp[ri, ci] = (byte)colour; + temp[ri, ci] = (byte) colour; } } } @@ -595,19 +592,19 @@ namespace CdgLib { for (ci = 0; ci <= hScrollPixels - 1; ci++) { - for (ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = 0; ri <= CdgFullHeight - 1; ri++) { - temp[ri, ci] = (byte)colour; + temp[ri, ci] = (byte) colour; } } } else if (hScrollPixels < 0) { - for (ci = CDG_FULL_WIDTH + hScrollPixels; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = CdgFullWidth + hScrollPixels; ci <= CdgFullWidth - 1; ci++) { - for (ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = 0; ri <= CdgFullHeight - 1; ri++) { - temp[ri, ci] = (byte)colour; + temp[ri, ci] = (byte) colour; } } } @@ -615,32 +612,32 @@ namespace CdgLib //Now copy the temporary buffer back to our array - for (ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (ri = 0; ri <= CdgFullHeight - 1; ri++) { - for (ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (ci = 0; ci <= CdgFullWidth - 1; ci++) { - m_pixelColours[ri, ci] = temp[ri, ci]; + _mPixelColours[ri, ci] = temp[ri, ci]; } } } - private void render() + private void Render() { - if (m_pSurface == null) + if (_mPSurface == null) return; - for (var ri = 0; ri <= CDG_FULL_HEIGHT - 1; ri++) + for (var ri = 0; ri <= CdgFullHeight - 1; ri++) { - for (var ci = 0; ci <= CDG_FULL_WIDTH - 1; ci++) + for (var ci = 0; ci <= CdgFullWidth - 1; ci++) { - if (ri < TILE_HEIGHT || ri >= CDG_FULL_HEIGHT - TILE_HEIGHT || ci < TILE_WIDTH || - ci >= CDG_FULL_WIDTH - TILE_WIDTH) + if (ri < TileHeight || ri >= CdgFullHeight - TileHeight || ci < TileWidth || + ci >= CdgFullWidth - TileWidth) { - m_pSurface.rgbData[ri, ci] = m_colourTable[m_borderColourIndex]; + _mPSurface.RgbData[ri, ci] = _mColourTable[_mBorderColourIndex]; } else { - m_pSurface.rgbData[ri, ci] = m_colourTable[m_pixelColours[ri + m_vOffset, ci + m_hOffset]]; + _mPSurface.RgbData[ri, ci] = _mColourTable[_mPixelColours[ri + _mVOffset, ci + _mHOffset]]; } } } @@ -648,30 +645,4 @@ namespace CdgLib #endregion } -} - - -namespace CdgLib -{ - public class CdgPacket - { - public byte[] command = new byte[1]; - public byte[] data = new byte[16]; - public byte[] instruction = new byte[1]; - public byte[] parityP = new byte[4]; - public byte[] parityQ = new byte[2]; - } -} - -namespace CdgLib -{ - public class ISurface - { - public int[,] rgbData = new int[CDGFile.CDG_FULL_HEIGHT, CDGFile.CDG_FULL_WIDTH]; - - public int MapRGBColour(int red, int green, int blue) - { - return Color.FromArgb(red, green, blue).ToArgb(); - } - } -} +} \ No newline at end of file diff --git a/CdgLib/CdgFileIoStream.cs b/CdgLib/CdgFileIoStream.cs index 8d25f5d..91a4ff0 100644 --- a/CdgLib/CdgFileIoStream.cs +++ b/CdgLib/CdgFileIoStream.cs @@ -2,7 +2,6 @@ namespace CdgLib { - /// /// public class CdgFileIoStream @@ -17,7 +16,7 @@ namespace CdgLib } /// - /// Reads the specified buf. + /// Reads the specified buf. /// /// The buf. /// The buf_size. @@ -28,7 +27,7 @@ namespace CdgLib } /// - /// Writes the specified buf. + /// Writes the specified buf. /// /// The buf. /// The buf_size. @@ -40,18 +39,18 @@ namespace CdgLib } /// - /// Seeks the specified offset. + /// Seeks the specified offset. /// /// The offset. /// The whence. /// public int Seek(int offset, SeekOrigin whence) { - return (int)_cdgFile.Seek(offset, whence); + return (int) _cdgFile.Seek(offset, whence); } /// - /// EOFs this instance. + /// EOFs this instance. /// /// public bool Eof() @@ -60,16 +59,16 @@ namespace CdgLib } /// - /// Getsizes this instance. + /// Getsizes this instance. /// /// public int Getsize() { - return (int)_cdgFile.Length; + return (int) _cdgFile.Length; } /// - /// Opens the specified filename. + /// Opens the specified filename. /// /// The filename. /// @@ -81,7 +80,7 @@ namespace CdgLib } /// - /// Closes this instance. + /// Closes this instance. /// public void Close() { @@ -92,5 +91,4 @@ namespace CdgLib } } } -} - +} \ No newline at end of file diff --git a/CdgLib/CdgLib.csproj b/CdgLib/CdgLib.csproj index 3103364..bba14ac 100644 --- a/CdgLib/CdgLib.csproj +++ b/CdgLib/CdgLib.csproj @@ -41,9 +41,11 @@ - + + + diff --git a/CdgLib/GraphicUtil.cs b/CdgLib/GraphicUtil.cs index d64191f..9638221 100644 --- a/CdgLib/GraphicUtil.cs +++ b/CdgLib/GraphicUtil.cs @@ -17,10 +17,10 @@ namespace CdgLib /// public static Stream BitmapToStream(string filename) { - var oldBmp = (Bitmap)Image.FromFile(filename); + var oldBmp = (Bitmap) Image.FromFile(filename); var oldData = oldBmp.LockBits(new Rectangle(0, 0, oldBmp.Width, oldBmp.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb); - var length = oldData.Stride * oldBmp.Height; + var length = oldData.Stride*oldBmp.Height; var stream = new byte[length]; Marshal.Copy(oldData.Scan0, stream, 0, length); oldBmp.UnlockBits(oldData); @@ -61,7 +61,7 @@ namespace CdgLib public static Bitmap GetCdgSizeBitmap(string filename) { var bm = new Bitmap(filename); - return ResizeBitmap(ref bm, CDGFile.CDG_FULL_WIDTH, CDGFile.CDG_FULL_HEIGHT); + return ResizeBitmap(ref bm, CdgFile.CdgFullWidth, CdgFile.CdgFullHeight); } /// @@ -106,4 +106,4 @@ namespace CdgLib return mergedImage; } } -} +} \ No newline at end of file diff --git a/CdgLib/Properties/AssemblyInfo.cs b/CdgLib/Properties/AssemblyInfo.cs index 0b89514..7ffdfe0 100644 --- a/CdgLib/Properties/AssemblyInfo.cs +++ b/CdgLib/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. + [assembly: AssemblyTitle("CdgLib")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -17,9 +17,11 @@ using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM + [assembly: Guid("3203dfd2-da5b-47b3-b009-18dd9c401fc3")] // Version information for an assembly consists of the following four values: @@ -32,5 +34,6 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] + [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/CdgLib/Surface.cs b/CdgLib/Surface.cs new file mode 100644 index 0000000..6a1e4bd --- /dev/null +++ b/CdgLib/Surface.cs @@ -0,0 +1,14 @@ +using System.Drawing; + +namespace CdgLib +{ + public class Surface + { + public int[,] RgbData = new int[CdgFile.CdgFullHeight, CdgFile.CdgFullWidth]; + + public int MapRgbColour(int red, int green, int blue) + { + return Color.FromArgb(red, green, blue).ToArgb(); + } + } +} \ No newline at end of file diff --git a/CdgLib/cdgPacket.cs b/CdgLib/cdgPacket.cs new file mode 100644 index 0000000..636686c --- /dev/null +++ b/CdgLib/cdgPacket.cs @@ -0,0 +1,11 @@ +namespace CdgLib +{ + public class CdgPacket + { + public byte[] Command = new byte[1]; + public byte[] Data = new byte[16]; + public byte[] Instruction = new byte[1]; + public byte[] ParityP = new byte[4]; + public byte[] ParityQ = new byte[2]; + } +} \ No newline at end of file diff --git a/KaraokeConverter/App.config b/KaraokeConverter/App.config index 8324aa6..9350691 100644 --- a/KaraokeConverter/App.config +++ b/KaraokeConverter/App.config @@ -1,6 +1,7 @@ - + + - - - + + + \ No newline at end of file diff --git a/KaraokeConverter/ExportAVI.cs b/KaraokeConverter/ExportAVI.cs index 769f04e..782cf7f 100644 --- a/KaraokeConverter/ExportAVI.cs +++ b/KaraokeConverter/ExportAVI.cs @@ -1,34 +1,33 @@ -using AviFile; -using CdgLib; -using System; -using System.Collections.Generic; +using System; using System.Drawing; -using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; using System.Windows.Forms; +using AviFile; +using CdgLib; namespace KaraokeConverter { public class ExportAVI { + public delegate void StatusEventHandler(string message); - public void CDGtoAVI(string aviFileName, string cdgFileName, string mp3FileName, double frameRate, string backgroundFileName = "") + public void CDGtoAVI(string aviFileName, string cdgFileName, string mp3FileName, double frameRate, + string backgroundFileName = "") { Bitmap backgroundBmp = null; Bitmap mergedBMP = null; VideoStream aviStream = null; - CDGFile myCDGFile = new CDGFile(cdgFileName); - myCDGFile.renderAtPosition(0); - Bitmap bitmap__1 = (Bitmap)myCDGFile.RgbImage; + var myCDGFile = new CdgFile(cdgFileName); + myCDGFile.RenderAtPosition(0); + var bitmap__1 = (Bitmap) myCDGFile.RgbImage; if (!string.IsNullOrEmpty(backgroundFileName)) { try { if (IsMovie(backgroundFileName)) - backgroundBmp = MovieFrameExtractor.GetBitmap(0, backgroundFileName, CDGFile.CDG_FULL_WIDTH, CDGFile.CDG_FULL_HEIGHT); + backgroundBmp = MovieFrameExtractor.GetBitmap(0, backgroundFileName, CdgFile.CdgFullWidth, + CdgFile.CdgFullHeight); if (IsGraphic(backgroundFileName)) backgroundBmp = GraphicUtil.GetCdgSizeBitmap(backgroundFileName); } @@ -36,7 +35,7 @@ namespace KaraokeConverter { } } - AviManager aviManager = new AviManager(aviFileName, false); + var aviManager = new AviManager(aviFileName, false); if (backgroundBmp != null) { mergedBMP = GraphicUtil.MergeImagesWithTransparency(backgroundBmp, bitmap__1); @@ -45,24 +44,26 @@ namespace KaraokeConverter if (IsMovie(backgroundFileName)) backgroundBmp.Dispose(); } - else { + else + { aviStream = aviManager.AddVideoStream(true, frameRate, bitmap__1); } - int count = 0; - double frameInterval = 1000 / frameRate; - long totalDuration = myCDGFile.getTotalDuration(); + var count = 0; + var frameInterval = 1000/frameRate; + var totalDuration = myCDGFile.GetTotalDuration(); double position = 0; while (position <= totalDuration) { count += 1; - position = count * frameInterval; - myCDGFile.renderAtPosition(Convert.ToInt64(position)); - bitmap__1 = (Bitmap)myCDGFile.RgbImage; + position = count*frameInterval; + myCDGFile.RenderAtPosition(Convert.ToInt64(position)); + bitmap__1 = (Bitmap) myCDGFile.RgbImage; if (!string.IsNullOrEmpty(backgroundFileName)) { if (IsMovie(backgroundFileName)) - backgroundBmp = MovieFrameExtractor.GetBitmap(position / 1000, backgroundFileName, CDGFile.CDG_FULL_WIDTH, CDGFile.CDG_FULL_HEIGHT); + backgroundBmp = MovieFrameExtractor.GetBitmap(position/1000, backgroundFileName, + CdgFile.CdgFullWidth, CdgFile.CdgFullHeight); } if (backgroundBmp != null) { @@ -72,11 +73,12 @@ namespace KaraokeConverter if (IsMovie(backgroundFileName)) backgroundBmp.Dispose(); } - else { + else + { aviStream.AddFrame(bitmap__1); } bitmap__1.Dispose(); - int percentageDone = (int)((position / totalDuration) * 100); + var percentageDone = (int) (position/totalDuration*100); if (Status != null) { Status(percentageDone.ToString()); @@ -119,12 +121,10 @@ namespace KaraokeConverter public static bool IsGraphic(string filename) { - return Regex.IsMatch(filename, "^.+(\\.jpg|\\.bmp|\\.png|\\.tif|\\.tiff|\\.gif|\\.wmf)$", RegexOptions.IgnoreCase); + return Regex.IsMatch(filename, "^.+(\\.jpg|\\.bmp|\\.png|\\.tif|\\.tiff|\\.gif|\\.wmf)$", + RegexOptions.IgnoreCase); } public event StatusEventHandler Status; - public delegate void StatusEventHandler(string message); - - } -} +} \ No newline at end of file diff --git a/KaraokeConverter/Form1.Designer.cs b/KaraokeConverter/Form1.Designer.cs index a60be36..fdf61ea 100644 --- a/KaraokeConverter/Form1.Designer.cs +++ b/KaraokeConverter/Form1.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.tbFileName = new System.Windows.Forms.TextBox(); this.btBrowseCDG = new System.Windows.Forms.Button(); this.OpenFileDialog1 = new System.Windows.Forms.OpenFileDialog(); @@ -48,12 +49,17 @@ this.GroupBox2 = new System.Windows.Forms.GroupBox(); this.GroupBox1 = new System.Windows.Forms.GroupBox(); this.pbAVI = new System.Windows.Forms.ProgressBar(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.Panel2 = new System.Windows.Forms.Panel(); + this.vlcVideo = new AxAXVLC.AxVLCPlugin2(); this.SaveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.Panel1.SuspendLayout(); this.GroupBox3.SuspendLayout(); this.GroupBox2.SuspendLayout(); this.GroupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.Panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.vlcVideo)).BeginInit(); this.SuspendLayout(); // // tbFileName @@ -63,6 +69,8 @@ this.tbFileName.ReadOnly = true; this.tbFileName.Size = new System.Drawing.Size(475, 20); this.tbFileName.TabIndex = 0; + this.tbFileName.Text = "D:\\Karaoke\\SF001 - SF339 Sunfly Hits Karaoke Complete\\SF339\\SF339-01 - Kiesza - H" + + "ideaway.cdg"; // // btBrowseCDG // @@ -86,8 +94,9 @@ this.Panel1.Dock = System.Windows.Forms.DockStyle.Top; this.Panel1.Location = new System.Drawing.Point(0, 0); this.Panel1.Name = "Panel1"; - this.Panel1.Size = new System.Drawing.Size(577, 255); + this.Panel1.Size = new System.Drawing.Size(649, 255); this.Panel1.TabIndex = 3; + this.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.Panel1_Paint); // // GroupBox3 // @@ -158,6 +167,7 @@ this.tbBackGroundAVI.Name = "tbBackGroundAVI"; this.tbBackGroundAVI.Size = new System.Drawing.Size(356, 20); this.tbBackGroundAVI.TabIndex = 17; + this.tbBackGroundAVI.Text = "C:\\Users\\l-bre\\Downloads\\Kristel\'s Jams\\drop.avi"; // // btBackGroundBrowse // @@ -185,6 +195,7 @@ this.tbAVIFile.Name = "tbAVIFile"; this.tbAVIFile.Size = new System.Drawing.Size(356, 20); this.tbAVIFile.TabIndex = 9; + this.tbAVIFile.Text = "C:\\Users\\l-bre\\Desktop\\tester.avi"; // // btOutputAVI // @@ -251,29 +262,53 @@ this.pbAVI.Size = new System.Drawing.Size(555, 23); this.pbAVI.TabIndex = 14; // + // pictureBox1 + // + this.pictureBox1.Location = new System.Drawing.Point(207, 47); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(392, 151); + this.pictureBox1.TabIndex = 24; + this.pictureBox1.TabStop = false; + // // Panel2 // + this.Panel2.Controls.Add(this.pictureBox1); + this.Panel2.Controls.Add(this.vlcVideo); this.Panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.Panel2.Location = new System.Drawing.Point(0, 255); this.Panel2.Name = "Panel2"; - this.Panel2.Size = new System.Drawing.Size(577, 0); + this.Panel2.Size = new System.Drawing.Size(649, 225); this.Panel2.TabIndex = 4; + this.Panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.Panel2_Paint); + // + // vlcVideo + // + this.vlcVideo.Enabled = true; + this.vlcVideo.Location = new System.Drawing.Point(317, 47); + this.vlcVideo.Name = "vlcVideo"; + this.vlcVideo.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("vlcVideo.OcxState"))); + this.vlcVideo.Size = new System.Drawing.Size(320, 175); + this.vlcVideo.TabIndex = 25; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(577, 253); + this.ClientSize = new System.Drawing.Size(649, 480); this.Controls.Add(this.Panel2); this.Controls.Add(this.Panel1); this.Name = "Form1"; this.Text = "MP3+CDG To Video Converter"; + this.Load += new System.EventHandler(this.Form1_Load); this.Panel1.ResumeLayout(false); this.GroupBox3.ResumeLayout(false); this.GroupBox3.PerformLayout(); this.GroupBox2.ResumeLayout(false); this.GroupBox2.PerformLayout(); this.GroupBox1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.vlcVideo)).EndInit(); this.ResumeLayout(false); } @@ -309,6 +344,9 @@ #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private AxAXVLC.AxVLCPlugin2 vlcVideo; } } diff --git a/KaraokeConverter/Form1.cs b/KaraokeConverter/Form1.cs index 1a82fb5..7c19e3b 100644 --- a/KaraokeConverter/Form1.cs +++ b/KaraokeConverter/Form1.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Text.RegularExpressions; using System.Windows.Forms; using CdgLib; @@ -18,14 +13,25 @@ namespace KaraokeConverter { InitializeComponent(); } + + #region "Events" + + private void mExportAVI_Status(string message) + { + pbAVI.Value = Convert.ToInt32(message); + } + + #endregion + #region "Private Declarations" - private CDGFile mCDGFile; + private CdgFile mCDGFile; private CdgFileIoStream mCDGStream; private string mCDGFileName; private string mMP3FileName; private string mTempDir; private ExportAVI withEventsField_mExportAVI; + private ExportAVI mExportAVI { get { return withEventsField_mExportAVI; } @@ -41,28 +47,28 @@ namespace KaraokeConverter withEventsField_mExportAVI.Status += mExportAVI_Status; } } - } + #endregion #region "Control Events" - private void btOutputAVI_Click_1(System.Object sender, System.EventArgs e) + private void btOutputAVI_Click_1(object sender, EventArgs e) { SelectOutputAVI(); } - private void btBackGroundBrowse_Click(System.Object sender, System.EventArgs e) + private void btBackGroundBrowse_Click(object sender, EventArgs e) { SelectBackGroundAVI(); } - private void btConvert_Click(System.Object sender, System.EventArgs e) + private void btConvert_Click(object sender, EventArgs e) { ConvertAVI(); } - private void tbFPS_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) + private void tbFPS_KeyPress(object sender, KeyPressEventArgs e) { /* if ((Strings.Asc(e.KeyChar) >= Keys.D0 & Strings.Asc(e.KeyChar) <= Keys.D9) | Strings.Asc(e.KeyChar) == Keys.Back | e.KeyChar == ".") { @@ -73,14 +79,14 @@ namespace KaraokeConverter */ } - private void btBrowseCDG_Click(System.Object sender, System.EventArgs e) + private void btBrowseCDG_Click(object sender, EventArgs e) { OpenFileDialog1.Filter = "CDG or Zip Files (*.zip, *.cdg)|*.zip;*.cdg"; OpenFileDialog1.ShowDialog(); tbFileName.Text = OpenFileDialog1.FileName; } - private void chkBackGraph_CheckedChanged(System.Object sender, System.EventArgs e) + private void chkBackGraph_CheckedChanged(object sender, EventArgs e) { if (chkBackGround.Checked && chkBackGraph.Checked) { @@ -89,7 +95,7 @@ namespace KaraokeConverter ToggleCheckBox(); } - private void chkBackGround_CheckedChanged(System.Object sender, System.EventArgs e) + private void chkBackGround_CheckedChanged(object sender, EventArgs e) { if (chkBackGraph.Checked && chkBackGround.Checked) { @@ -98,22 +104,13 @@ namespace KaraokeConverter ToggleCheckBox(); } - private void btBrowseImg_Click(System.Object sender, System.EventArgs e) + private void btBrowseImg_Click(object sender, EventArgs e) { SelectBackGroundGraphic(); } #endregion - #region "Events" - - private void mExportAVI_Status(string message) - { - pbAVI.Value = (Convert.ToInt32(message)); - } - - #endregion - #region "Private Methods" private void SelectOutputAVI() @@ -154,12 +151,13 @@ namespace KaraokeConverter } mExportAVI = new ExportAVI(); pbAVI.Value = 0; - string backGroundFilename = ""; + var backGroundFilename = ""; if (chkBackGraph.Checked) backGroundFilename = tbBackGroundImg.Text; if (chkBackGround.Checked) backGroundFilename = tbBackGroundAVI.Text; - mExportAVI.CDGtoAVI(tbAVIFile.Text, mCDGFileName, mMP3FileName, Convert.ToDouble(tbFPS.Text), backGroundFilename); + mExportAVI.CDGtoAVI(tbAVIFile.Text, mCDGFileName, mMP3FileName, Convert.ToDouble(tbFPS.Text), + backGroundFilename); pbAVI.Value = 0; try { @@ -188,14 +186,13 @@ namespace KaraokeConverter private void PreProcessFiles() { - /* + string myCDGFileName = ""; if (Regex.IsMatch(tbFileName.Text, "\\.zip$")) { string myTempDir = Path.GetTempPath() + Path.GetRandomFileName(); Directory.CreateDirectory(myTempDir); mTempDir = myTempDir; myCDGFileName = Unzip.UnzipMP3GFiles(tbFileName.Text, myTempDir); - goto PairUpFiles; } else if (Regex.IsMatch(tbFileName.Text, "\\.cdg$")) { myCDGFileName = tbFileName.Text; PairUpFiles: @@ -206,7 +203,7 @@ namespace KaraokeConverter mTempDir = ""; } } - */ + } @@ -220,5 +217,26 @@ namespace KaraokeConverter #endregion + private void Panel1_Paint(object sender, PaintEventArgs e) + { + + } + + private void Panel2_Paint(object sender, PaintEventArgs e) + { + + } + + private void Form1_Load(object sender, EventArgs e) + { + + + + var file = new Uri(@"D:\HDMovies\28 Weeks Later (2007)\28.Weeks.Later.2007.720p.BrRip.264.YIFY.mp4"); + vlcVideo.playlist.add(file.AbsoluteUri); + vlcVideo.playlist.play(); + + + } } -} +} \ No newline at end of file diff --git a/KaraokeConverter/Form1.resx b/KaraokeConverter/Form1.resx index fdfe6a4..ff828c2 100644 --- a/KaraokeConverter/Form1.resx +++ b/KaraokeConverter/Form1.resx @@ -120,6 +120,20 @@ 17, 17 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAgwEAAAIB + AAAAAQAAAAAAAAAAAAAAAG4BAAAHAAAAKABDAG8AdQBuAHQAKQADAA0AAAAIAAAAQQB1AHQAbwBMAG8A + bwBwAAsAAAAIAAAAQQB1AHQAbwBQAGwAYQB5AAsA//8JAAAAQgBhAGMAawBDAG8AbABvAHIAAwAAAAAA + BwAAAEIAYQBzAGUAVQBSAEwACAAAAAAACAAAAEIAcgBhAG4AZABpAG4AZwALAP//DAAAAEUAeAB0AGUA + bgB0AEgAZQBpAGcAaAB0AAMAFhIAAAsAAABFAHgAdABlAG4AdABXAGkAZAB0AGgAAwATIQAAEQAAAEYA + dQBsAGwAcwBjAHIAZQBlAG4ARQBuAGEAYgBsAGUAZAALAP//AwAAAE0AUgBMAAgAAAAAAAkAAABTAHQA + YQByAHQAVABpAG0AZQADAAAAAAAHAAAAVABvAG8AbABiAGEAcgALAP//BwAAAFYAaQBzAGkAYgBsAGUA + CwD//wYAAABWAG8AbAB1AG0AZQADADIAAAAL + + 159, 17 diff --git a/KaraokeConverter/KaraokeConverter.csproj b/KaraokeConverter/KaraokeConverter.csproj index cd0a149..8f21fb1 100644 --- a/KaraokeConverter/KaraokeConverter.csproj +++ b/KaraokeConverter/KaraokeConverter.csproj @@ -12,9 +12,11 @@ v4.6 512 true + + - AnyCPU + x86 true full false @@ -22,6 +24,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -33,6 +36,22 @@ 4 + + ..\packages\Accord.3.0.2\lib\net45\Accord.dll + True + + + ..\packages\Accord.MachineLearning.3.0.2\lib\net45\Accord.MachineLearning.dll + True + + + ..\packages\Accord.Math.3.0.2\lib\net45\Accord.Math.dll + True + + + ..\packages\Accord.Statistics.3.0.2\lib\net45\Accord.Statistics.dll + True + False lib\AviFile.dll @@ -50,8 +69,21 @@ False lib\Interop.DexterLib.dll + + ..\packages\MediaToolkit.1.1.0.1\lib\net40\MediaToolkit.dll + True + + + ..\packages\NReco.VideoConverter.1.0.8.0\lib\net20\NReco.VideoConverter.dll + True + + + False + lib\NReco.VideoInfo.dll + + @@ -61,6 +93,18 @@ + + ..\packages\Vlc.DotNet.Core.2.1.115\lib\net45\x86\Vlc.DotNet.Core.dll + True + + + ..\packages\Vlc.DotNet.Core.Interops.2.1.115\lib\net45\x86\Vlc.DotNet.Core.Interops.dll + True + + + ..\packages\Vlc.DotNet.Forms.2.1.115\lib\net45\x86\Vlc.DotNet.Forms.dll + True + @@ -85,6 +129,7 @@ True Resources.resx + True @@ -101,10 +146,40 @@ - - - - + + Always + + + Always + + + Always + + + Always + + + + + + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + aximp + False + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + tlbimp + False + True + @@ -113,6 +188,13 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\Google.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/KaraokeConverter/Properties/Settings.settings b/KaraokeConverter/Properties/Settings.settings index 3964565..e04fc63 100644 --- a/KaraokeConverter/Properties/Settings.settings +++ b/KaraokeConverter/Properties/Settings.settings @@ -1,7 +1,8 @@  + - + \ No newline at end of file diff --git a/KaraokeConverter/Resources/Google.png b/KaraokeConverter/Resources/Google.png new file mode 100644 index 0000000..4cd9cd9 Binary files /dev/null and b/KaraokeConverter/Resources/Google.png differ diff --git a/KaraokeConverter/Unzip.cs b/KaraokeConverter/Unzip.cs index 2507dc2..7bd1c55 100644 --- a/KaraokeConverter/Unzip.cs +++ b/KaraokeConverter/Unzip.cs @@ -1,26 +1,21 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ICSharpCode.SharpZipLib.Zip; namespace KaraokeConverter { - public class Unzip { - public static string UnzipMP3GFiles(string zipFilename, string outputPath) { string functionReturnValue = null; functionReturnValue = ""; try { - ICSharpCode.SharpZipLib.Zip.FastZip myZip = new ICSharpCode.SharpZipLib.Zip.FastZip(); + var myZip = new FastZip(); myZip.ExtractZip(zipFilename, outputPath, ""); - DirectoryInfo myDirInfo = new DirectoryInfo(outputPath); - FileInfo[] myFileInfo = myDirInfo.GetFiles("*.cdg", SearchOption.AllDirectories); + var myDirInfo = new DirectoryInfo(outputPath); + var myFileInfo = myDirInfo.GetFiles("*.cdg", SearchOption.AllDirectories); if (myFileInfo.Length > 0) { functionReturnValue = myFileInfo[0].FullName; @@ -31,6 +26,5 @@ namespace KaraokeConverter } return functionReturnValue; } - } -} +} \ No newline at end of file diff --git a/KaraokeConverter/lib/NReco.VideoInfo.XML b/KaraokeConverter/lib/NReco.VideoInfo.XML new file mode 100644 index 0000000..5905fad --- /dev/null +++ b/KaraokeConverter/lib/NReco.VideoInfo.XML @@ -0,0 +1,162 @@ + + + + NReco.VideoInfo + + + + + The exception that is thrown when FFProbe process retruns non-zero error exit code + + + + + Get FFMpeg process error code + + + + + Provides information about media streams, video or audio files (wrapper for FFProbe command line tool) + + + + + Create new instance of HtmlToPdfConverter + + + + + Returns information about local media file or online stream (URL). + + local file path or URL + Structured information about media + + + + Gets or sets path where FFProbe.exe is extracted + + + By default this property initialized with folder with application assemblies. + For ASP.NET applications it is recommended to use "~/App_Code/". + + + + + Get or set FFProbe tool executive file name ('ffprobe.exe' by default) + + + + + Get or set custom WkHtmlToImage command line arguments + + + + + Gets or sets FFProbe process priority (Normal by default) + + + + + Gets or sets maximum execution time for running FFProbe process (null is by default = no timeout) + + + + + Include information about file format. + + + + + Include information about media streams. + + + + + Represents information about media file or stream. + + + + + Returns attribute value from FFProbe XML result. + + XPath selector + attribute value or null + + + + Media container format identifier. + + + + + Human-readable container format name. + + + + + List of media container tags. + + + + + List of media streams. + + + + + Total duration of the media. + + + + + FFProble XML result. + + + + + Represents information about stream. + + + + + Stream index + + + + + Codec name identifier + + + + + Human-readable codec name. + + + + + Codec type (video, audio). + + + + + Video stream pixel format (if applicable). + + Null is returned if pixel format is not available. + + + + Video frame width (if applicable). + + + + + Video frame height (if applicable) + + + + + Video frame rate per second (if applicable). + + + + diff --git a/KaraokeConverter/lib/NReco.VideoInfo.dll b/KaraokeConverter/lib/NReco.VideoInfo.dll new file mode 100644 index 0000000..727e72c Binary files /dev/null and b/KaraokeConverter/lib/NReco.VideoInfo.dll differ diff --git a/KaraokeConverter/packages.config b/KaraokeConverter/packages.config index 273ff53..43b7b5c 100644 --- a/KaraokeConverter/packages.config +++ b/KaraokeConverter/packages.config @@ -1,4 +1,13 @@  + + + + + + + + + \ No newline at end of file diff --git a/KaraokePlayer.sln b/KaraokePlayer.sln index 52544fa..250c386 100644 --- a/KaraokePlayer.sln +++ b/KaraokePlayer.sln @@ -3,18 +3,22 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25008.0 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CdgLib", "CdgLib\CdgLib.csproj", "{3203DFD2-DA5B-47B3-B009-18DD9C401FC3}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KaraokePlayer", "KaraokePlayer\KaraokePlayer.csproj", "{2CF318E2-04B5-40FC-9577-6DAC62B86FB2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KaraokeConverter", "KaraokeConverter\KaraokeConverter.csproj", "{2821C26D-52D8-43D9-BEF4-7CE4DFA60776}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CdgLib", "CdgLib\CdgLib.csproj", "{3203DFD2-DA5B-47B3-B009-18DD9C401FC3}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Release|Any CPU.Build.0 = Release|Any CPU {2CF318E2-04B5-40FC-9577-6DAC62B86FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2CF318E2-04B5-40FC-9577-6DAC62B86FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {2CF318E2-04B5-40FC-9577-6DAC62B86FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -23,10 +27,6 @@ Global {2821C26D-52D8-43D9-BEF4-7CE4DFA60776}.Debug|Any CPU.Build.0 = Debug|Any CPU {2821C26D-52D8-43D9-BEF4-7CE4DFA60776}.Release|Any CPU.ActiveCfg = Release|Any CPU {2821C26D-52D8-43D9-BEF4-7CE4DFA60776}.Release|Any CPU.Build.0 = Release|Any CPU - {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/KaraokePlayer/App.config b/KaraokePlayer/App.config index 8324aa6..9350691 100644 --- a/KaraokePlayer/App.config +++ b/KaraokePlayer/App.config @@ -1,6 +1,7 @@ - + + - - - + + + \ No newline at end of file diff --git a/KaraokePlayer/CDGWindow.Designer.cs b/KaraokePlayer/CDGWindow.Designer.cs index 2f3dff5..1ed195b 100644 --- a/KaraokePlayer/CDGWindow.Designer.cs +++ b/KaraokePlayer/CDGWindow.Designer.cs @@ -29,41 +29,77 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CDGWindow)); - this.PictureBox1 = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)this.PictureBox1).BeginInit(); + this.pbLyrics = new System.Windows.Forms.PictureBox(); + this.panel1 = new System.Windows.Forms.Panel(); + this.vlcPlayer = new Vlc.DotNet.Forms.VlcControl(); + ((System.ComponentModel.ISupportInitialize)(this.pbLyrics)).BeginInit(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.vlcPlayer)).BeginInit(); this.SuspendLayout(); - // - //PictureBox1 - // - this.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.PictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.PictureBox1.Location = new System.Drawing.Point(0, 0); - this.PictureBox1.Name = "PictureBox1"; - this.PictureBox1.Size = new System.Drawing.Size(300, 216); - this.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.PictureBox1.TabIndex = 0; - this.PictureBox1.TabStop = false; - // - //CDGWindow - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f); + // + // pbLyrics + // + this.pbLyrics.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.pbLyrics.Dock = System.Windows.Forms.DockStyle.Fill; + this.pbLyrics.Image = global::KaraokePlayer.Properties.Resources.Google; + this.pbLyrics.Location = new System.Drawing.Point(0, 0); + this.pbLyrics.Name = "pbLyrics"; + this.pbLyrics.Size = new System.Drawing.Size(553, 414); + this.pbLyrics.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pbLyrics.TabIndex = 0; + this.pbLyrics.TabStop = false; + // + // panel1 + // + this.panel1.Controls.Add(this.vlcPlayer); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Enabled = false; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(553, 414); + this.panel1.TabIndex = 2; + // + // vlcPlayer + // + this.vlcPlayer.BackColor = System.Drawing.Color.Black; + this.vlcPlayer.Dock = System.Windows.Forms.DockStyle.Fill; + this.vlcPlayer.Location = new System.Drawing.Point(0, 0); + this.vlcPlayer.Name = "vlcPlayer"; + this.vlcPlayer.Size = new System.Drawing.Size(553, 414); + this.vlcPlayer.Spu = -1; + this.vlcPlayer.TabIndex = 2; + this.vlcPlayer.Text = "vlcControl1"; + this.vlcPlayer.VlcLibDirectory = ((System.IO.DirectoryInfo)(resources.GetObject("vlcPlayer.VlcLibDirectory"))); + this.vlcPlayer.VlcMediaplayerOptions = new string[] { + "--audio-visual=visual", + "--effect-list=scope", + "--no-video"}; + // + // CDGWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.ClientSize = new System.Drawing.Size(300, 216); - this.Controls.Add(this.PictureBox1); + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.ClientSize = new System.Drawing.Size(553, 414); + this.Controls.Add(this.pbLyrics); + this.Controls.Add(this.panel1); this.KeyPreview = true; this.Name = "CDGWindow"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Karaoke"; - this.TopMost = true; - ((System.ComponentModel.ISupportInitialize)this.PictureBox1).EndInit(); + this.Load += new System.EventHandler(this.CDGWindow_Load); + this.DoubleClick += new System.EventHandler(this.CDGWindow_DoubleClick_1); + ((System.ComponentModel.ISupportInitialize)(this.pbLyrics)).EndInit(); + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.vlcPlayer)).EndInit(); this.ResumeLayout(false); } - public System.Windows.Forms.PictureBox PictureBox1; + public System.Windows.Forms.PictureBox pbLyrics; #endregion + private System.Windows.Forms.Panel panel1; + private Vlc.DotNet.Forms.VlcControl vlcPlayer; } } \ No newline at end of file diff --git a/KaraokePlayer/CDGWindow.cs b/KaraokePlayer/CDGWindow.cs index 4e19210..0871f43 100644 --- a/KaraokePlayer/CDGWindow.cs +++ b/KaraokePlayer/CDGWindow.cs @@ -1,63 +1,47 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; +using System.Collections; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace KaraokePlayer { public partial class CDGWindow : Form { - - private void CDGWindow_DoubleClick(object sender, System.EventArgs e) - { - AutoSizeWindow(); - } - - private void PictureBox1_DoubleClick(object sender, System.EventArgs e) - { - AutoSizeWindow(); - } - - private void AutoSizeWindow() - { - if (this.WindowState == FormWindowState.Normal) - { - this.WindowState = FormWindowState.Maximized; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.TopMost = true; - this.Refresh(); - } - else { - this.WindowState = FormWindowState.Normal; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; - this.TopMost = false; - this.Refresh(); - } - } - - private void CDGWindow_SizeChanged(object sender, System.EventArgs e) - { - if (this.WindowState == FormWindowState.Maximized) - { - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.TopMost = true; - } - else { - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; - this.TopMost = false; - } - } public CDGWindow() { - SizeChanged += CDGWindow_SizeChanged; - DoubleClick += CDGWindow_DoubleClick; InitializeComponent(); + } + + private void CDGWindow_Load(object sender, EventArgs e) + { + + + var plexiGlass =new Plexiglass(this); + plexiGlass.Controls.Add(pbLyrics); + var file = new Uri(@"D:\Karaoke\SF001 - SF339 Sunfly Hits Karaoke Complete\SF339\SF339-01 - Kiesza - Hideaway.mp3"); + + vlcPlayer.SetMedia(file); + vlcPlayer.Play(); + + + + } + + private void CDGWindow_DoubleClick_1(object sender, EventArgs e) + { + if (WindowState == FormWindowState.Maximized) + { + FormBorderStyle = FormBorderStyle.Sizable; + this.WindowState = FormWindowState.Normal; + } + else + { + FormBorderStyle = FormBorderStyle.None; + this.WindowState = FormWindowState.Maximized; + } + + } } -} +} \ No newline at end of file diff --git a/KaraokePlayer/CDGWindow.resx b/KaraokePlayer/CDGWindow.resx new file mode 100644 index 0000000..86edd14 --- /dev/null +++ b/KaraokePlayer/CDGWindow.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAEAQAAABdTeXN0ZW0uSU8uRGlyZWN0b3J5SW5mbwIAAAAMT3JpZ2luYWxQ + YXRoCEZ1bGxQYXRoAQEGAgAAACNDOlxQcm9ncmFtIEZpbGVzICh4ODYpXFZpZGVvTEFOXFZMQwkCAAAA + Cw== + + + \ No newline at end of file diff --git a/KaraokePlayer/Form1.Designer.cs b/KaraokePlayer/Form1.Designer.cs index 5605616..4f36bf1 100644 --- a/KaraokePlayer/Form1.Designer.cs +++ b/KaraokePlayer/Form1.Designer.cs @@ -56,6 +56,8 @@ this.tbFileName.ReadOnly = true; this.tbFileName.Size = new System.Drawing.Size(309, 20); this.tbFileName.TabIndex = 0; + this.tbFileName.Text = "D:\\Karaoke\\SF001 - SF339 Sunfly Hits Karaoke Complete\\SF339\\SF339-01 - Kiesza - H" + + "ideaway.cdg"; // // btBrowse // diff --git a/KaraokePlayer/Form1.cs b/KaraokePlayer/Form1.cs index 1e9a57f..7978966 100644 --- a/KaraokePlayer/Form1.cs +++ b/KaraokePlayer/Form1.cs @@ -1,318 +1,328 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.IO; +using System.Text.RegularExpressions; using System.Windows.Forms; using CdgLib; using Un4seen.Bass; -using System.Text.RegularExpressions; -using System.IO; +using Un4seen.Bass.AddOn.Fx; namespace KaraokePlayer { public partial class Form1 : Form -{ + { public Form1() { InitializeComponent(); } - #region "Private Declarations" + #region "Private Declarations" - private CDGFile mCDGFile; - private CdgFileIoStream mCDGStream; - private int mSemitones = 0; - private bool mPaused; - private long mFrameCount = 0; - private bool mStop; - private string mCDGFileName; - private string mMP3FileName; - private string mTempDir; - private int mMP3Stream; - private CDGWindow withEventsField_mCDGWindow = new CDGWindow(); - private CDGWindow mCDGWindow { - get { return withEventsField_mCDGWindow; } - set { - if (withEventsField_mCDGWindow != null) { - withEventsField_mCDGWindow.FormClosing -= mCDGWindow_FormClosing; - } - withEventsField_mCDGWindow = value; - if (withEventsField_mCDGWindow != null) { - withEventsField_mCDGWindow.FormClosing += mCDGWindow_FormClosing; - } - } - } + private CdgFile mCDGFile; + private CdgFileIoStream mCDGStream; + private int mSemitones = 0; + private bool mPaused; + private long mFrameCount; + private bool mStop; + private string mCDGFileName; + private string mMP3FileName; + private string mTempDir; + private int mMP3Stream; + private CDGWindow withEventsField_mCDGWindow = new CDGWindow(); - private bool mBassInitalized = false; - #endregion + private CDGWindow mCDGWindow + { + get { return withEventsField_mCDGWindow; } + set + { + if (withEventsField_mCDGWindow != null) + { + withEventsField_mCDGWindow.FormClosing -= mCDGWindow_FormClosing; + } + withEventsField_mCDGWindow = value; + if (withEventsField_mCDGWindow != null) + { + withEventsField_mCDGWindow.FormClosing += mCDGWindow_FormClosing; + } + } + } - #region "Control Events" + private bool mBassInitalized; - private void Form1_Load(object sender, System.EventArgs e) - { - //Add registration key here if you have a license - //BassNet.Registration("email@domain.com", "0000000000000000") - try { - Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle); - mBassInitalized = true; - } catch (Exception ex) { - MessageBox.Show("Unable to initialize the audio playback system."); - } - } + #endregion - private void Button1_Click(System.Object sender, System.EventArgs e) - { - BrowseCDGZip(); - } + #region "Control Events" - private void Form1_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) - { - StopPlayback(); - } + private void Form1_Load(object sender, EventArgs e) + { + //Add registration key here if you have a license + //BassNet.Registration("email@domain.com", "0000000000000000") + try + { + Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, Handle); + mBassInitalized = true; + } + catch (Exception ex) + { + MessageBox.Show("Unable to initialize the audio playback system."); + } + } - private void tsbPlay_Click(System.Object sender, System.EventArgs e) - { - Play(); - } + private void Button1_Click(object sender, EventArgs e) + { + BrowseCDGZip(); + } - private void tsbStop_Click(System.Object sender, System.EventArgs e) - { - try { - StopPlayback(); - } catch (Exception ex) { - //Do nothing for now - } - } + private void Form1_FormClosed(object sender, FormClosedEventArgs e) + { + StopPlayback(); + } - private void tsbPause_Click(System.Object sender, System.EventArgs e) - { - Pause(); - } + private void tsbPlay_Click(object sender, EventArgs e) + { + Play(); + } - private void TrackBar1_Scroll(System.Object sender, System.EventArgs e) - { - AdjustVolume(); - } + private void tsbStop_Click(object sender, EventArgs e) + { + try + { + StopPlayback(); + } + catch (Exception ex) + { + //Do nothing for now + } + } - private void nudKey_ValueChanged(System.Object sender, System.EventArgs e) - { - AdjustPitch(); - } + private void tsbPause_Click(object sender, EventArgs e) + { + Pause(); + } - private void mCDGWindow_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) - { - StopPlayback(); - mCDGWindow.Hide(); - e.Cancel = true; - } + private void TrackBar1_Scroll(object sender, EventArgs e) + { + AdjustVolume(); + } - #endregion + private void nudKey_ValueChanged(object sender, EventArgs e) + { + AdjustPitch(); + } - #region "CDG + MP3 Playback Operations" + private void mCDGWindow_FormClosing(object sender, FormClosingEventArgs e) + { + StopPlayback(); + mCDGWindow.Hide(); + e.Cancel = true; + } - private void Pause() - { - mPaused = !mPaused; - if (mMP3Stream != 0) { - if (Bass.BASS_ChannelIsActive(mMP3Stream) != BASSActive.BASS_ACTIVE_PLAYING) { - Bass.BASS_ChannelPlay(mMP3Stream, false); - tsbPause.Text = "Pause"; - } else { - Bass.BASS_ChannelPause(mMP3Stream); - tsbPause.Text = "Resume"; - } - } - } + #endregion - private void PlayMP3Bass(string mp3FileName) - { - if (mBassInitalized || Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle)) { - mMP3Stream = 0; - mMP3Stream = Bass.BASS_StreamCreateFile(mp3FileName, 0, 0, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN); - mMP3Stream = Un4seen.Bass.AddOn.Fx.BassFx.BASS_FX_TempoCreate(mMP3Stream, BASSFlag.BASS_FX_FREESOURCE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_SAMPLE_LOOP); - if (mMP3Stream != 0) { - AdjustPitch(); - AdjustVolume(); - ShowCDGWindow(); - Bass.BASS_ChannelPlay(mMP3Stream, false); - } else { - throw new Exception(string.Format("Stream error: {0}", Bass.BASS_ErrorGetCode())); - } - } - } + #region "CDG + MP3 Playback Operations" - private void StopPlaybackBass() - { - Bass.BASS_Stop(); - Bass.BASS_StreamFree(mMP3Stream); - Bass.BASS_Free(); - mMP3Stream = 0; - mBassInitalized = false; - } + private void Pause() + { + mPaused = !mPaused; + if (mMP3Stream != 0) + { + if (Bass.BASS_ChannelIsActive(mMP3Stream) != BASSActive.BASS_ACTIVE_PLAYING) + { + Bass.BASS_ChannelPlay(mMP3Stream, false); + tsbPause.Text = "Pause"; + } + else + { + Bass.BASS_ChannelPause(mMP3Stream); + tsbPause.Text = "Resume"; + } + } + } - private void StopPlayback() - { - mStop = true; - HideCDGWindow(); - StopPlaybackBass(); - mCDGFile.Dispose(); - CleanUp(); - } + private void PlayMP3Bass(string mp3FileName) + { + if (mBassInitalized || Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, Handle)) + { + mMP3Stream = 0; + mMP3Stream = Bass.BASS_StreamCreateFile(mp3FileName, 0, 0, + BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN); + mMP3Stream = BassFx.BASS_FX_TempoCreate(mMP3Stream, + BASSFlag.BASS_FX_FREESOURCE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_SAMPLE_LOOP); + if (mMP3Stream != 0) + { + AdjustPitch(); + AdjustVolume(); + ShowCDGWindow(); + Bass.BASS_ChannelPlay(mMP3Stream, false); + } + else + { + throw new Exception(string.Format("Stream error: {0}", Bass.BASS_ErrorGetCode())); + } + } + } - private void PausePlayback() - { - Bass.BASS_Pause(); - } + private void StopPlaybackBass() + { + Bass.BASS_Stop(); + Bass.BASS_StreamFree(mMP3Stream); + Bass.BASS_Free(); + mMP3Stream = 0; + mBassInitalized = false; + } - private void ResumePlayback() - { - Bass.BASS_Pause(); - } + private void StopPlayback() + { + mStop = true; + HideCDGWindow(); + StopPlaybackBass(); + mCDGFile.Dispose(); + CleanUp(); + } - private void Play() - { - try { - if (mMP3Stream != 0 && Bass.BASS_ChannelIsActive(mMP3Stream) == BASSActive.BASS_ACTIVE_PLAYING) { - StopPlayback(); - } - PreProcessFiles(); - if (string.IsNullOrEmpty(mCDGFileName) | string.IsNullOrEmpty(mMP3FileName)) { - MessageBox.Show("Cannot find a CDG and MP3 file to play together."); - StopPlayback(); - return; - } - mPaused = false; - mStop = false; - mFrameCount = 0; - mCDGFile = new CDGFile(mCDGFileName); - long cdgLength = mCDGFile.getTotalDuration(); - PlayMP3Bass(mMP3FileName); - DateTime startTime = DateTime.Now; - var endTime = startTime.AddMilliseconds(mCDGFile.getTotalDuration()); - long millisecondsRemaining = cdgLength; - while (millisecondsRemaining > 0) { - if (mStop) { - break; // TODO: might not be correct. Was : Exit While - } - millisecondsRemaining = (long)endTime.Subtract(DateTime.Now).TotalMilliseconds; - long pos = cdgLength - millisecondsRemaining; - while (mPaused) { - endTime = DateTime.Now.AddMilliseconds(millisecondsRemaining); - Application.DoEvents(); - } - mCDGFile.renderAtPosition(pos); - mFrameCount += 1; - mCDGWindow.PictureBox1.Image = mCDGFile.RgbImage; - mCDGWindow.PictureBox1.BackColor = ((Bitmap)mCDGFile.RgbImage).GetPixel(1, 1); - mCDGWindow.PictureBox1.Refresh(); - - Application.DoEvents(); - } - StopPlayback(); - } catch (Exception ex) { - } - } + private void PausePlayback() + { + Bass.BASS_Pause(); + } - private void AdjustPitch() - { - if (mMP3Stream != 0) { - Bass.BASS_ChannelSetAttribute(mMP3Stream, BASSAttribute.BASS_ATTRIB_TEMPO_PITCH, (float)nudKey.Value); - } - } + private void ResumePlayback() + { + Bass.BASS_Pause(); + } - private void AdjustVolume() - { - if (mMP3Stream != 0) { - Bass.BASS_ChannelSetAttribute(mMP3Stream, BASSAttribute.BASS_ATTRIB_VOL, trbVolume.Value == 0 ? 0 : (trbVolume.Value / 100)); - } - } + private void Play() + { + try + { + if (mMP3Stream != 0 && Bass.BASS_ChannelIsActive(mMP3Stream) == BASSActive.BASS_ACTIVE_PLAYING) + { + StopPlayback(); + } + PreProcessFiles(); + if (string.IsNullOrEmpty(mCDGFileName) | string.IsNullOrEmpty(mMP3FileName)) + { + MessageBox.Show("Cannot find a CDG and MP3 file to play together."); + StopPlayback(); + return; + } + mPaused = false; + mStop = false; + mFrameCount = 0; + mCDGFile = new CdgFile(mCDGFileName); + var cdgLength = mCDGFile.GetTotalDuration(); + PlayMP3Bass(mMP3FileName); + var startTime = DateTime.Now; + var endTime = startTime.AddMilliseconds(mCDGFile.GetTotalDuration()); + var millisecondsRemaining = cdgLength; + while (millisecondsRemaining > 0) + { + if (mStop) + { + break; // TODO: might not be correct. Was : Exit While + } + millisecondsRemaining = (long) endTime.Subtract(DateTime.Now).TotalMilliseconds; + var pos = cdgLength - millisecondsRemaining; + while (mPaused) + { + endTime = DateTime.Now.AddMilliseconds(millisecondsRemaining); + Application.DoEvents(); + } + mCDGFile.RenderAtPosition(pos); + mFrameCount += 1; + mCDGWindow.pbLyrics.Image = mCDGFile.RgbImage; + mCDGWindow.pbLyrics.BackColor = ((Bitmap) mCDGFile.RgbImage).GetPixel(1, 1); + mCDGWindow.pbLyrics.Refresh(); - #endregion + Application.DoEvents(); + } + StopPlayback(); + } + catch (Exception ex) + { + } + } - #region "File Access" + private void AdjustPitch() + { + if (mMP3Stream != 0) + { + Bass.BASS_ChannelSetAttribute(mMP3Stream, BASSAttribute.BASS_ATTRIB_TEMPO_PITCH, (float) nudKey.Value); + } + } - private void BrowseCDGZip() - { - OpenFileDialog1.Filter = "CDG or Zip Files (*.zip, *.cdg)|*.zip;*.cdg"; - OpenFileDialog1.ShowDialog(); - tbFileName.Text = OpenFileDialog1.FileName; - } + private void AdjustVolume() + { + if (mMP3Stream != 0) + { + Bass.BASS_ChannelSetAttribute(mMP3Stream, BASSAttribute.BASS_ATTRIB_VOL, + trbVolume.Value == 0 ? 0 : trbVolume.Value/100); + } + } - private void PreProcessFiles() - { - - string myCDGFileName = ""; - if (Regex.IsMatch(tbFileName.Text, "\\.zip$")) { - string myTempDir = Path.GetTempPath() + Path.GetRandomFileName(); - Directory.CreateDirectory(myTempDir); - mTempDir = myTempDir; - myCDGFileName = Unzip.UnzipMP3GFiles(tbFileName.Text, myTempDir); + #endregion - } else if (Regex.IsMatch(tbFileName.Text, "\\.cdg$")) { - myCDGFileName = tbFileName.Text; - PairUpFiles: - string myMP3FileName = System.Text.RegularExpressions.Regex.Replace(myCDGFileName, "\\.cdg$", ".mp3"); - if (File.Exists(myMP3FileName)) { - mMP3FileName = myMP3FileName; - mCDGFileName = myCDGFileName; - mTempDir = ""; - } - } - - } + #region "File Access" - private void CleanUp() - { - if (!string.IsNullOrEmpty(mTempDir)) { - try { - Directory.Delete(mTempDir, true); - } catch (Exception ex) { - } - } - mTempDir = ""; - } + private void BrowseCDGZip() + { + OpenFileDialog1.Filter = "CDG or Zip Files (*.zip, *.cdg)|*.zip;*.cdg"; + OpenFileDialog1.ShowDialog(); + tbFileName.Text = OpenFileDialog1.FileName; + } - #endregion + private void PreProcessFiles() + { + var myCDGFileName = ""; + if (Regex.IsMatch(tbFileName.Text, "\\.zip$")) + { + var myTempDir = Path.GetTempPath() + Path.GetRandomFileName(); + Directory.CreateDirectory(myTempDir); + mTempDir = myTempDir; + myCDGFileName = Unzip.UnzipMP3GFiles(tbFileName.Text, myTempDir); + } + else if (Regex.IsMatch(tbFileName.Text, "\\.cdg$")) + { + myCDGFileName = tbFileName.Text; + var myMP3FileName = Regex.Replace(myCDGFileName, "\\.cdg$", ".mp3"); + if (File.Exists(myMP3FileName)) + { + mMP3FileName = myMP3FileName; + mCDGFileName = myCDGFileName; + mTempDir = ""; + } + } + } - #region "CDG Graphics Window" + private void CleanUp() + { + if (!string.IsNullOrEmpty(mTempDir)) + { + try + { + Directory.Delete(mTempDir, true); + } + catch (Exception ex) + { + } + } + mTempDir = ""; + } - private void ShowCDGWindow() - { - mCDGWindow.Show(); - } + #endregion - private void HideCDGWindow() - { - mCDGWindow.PictureBox1.Image = null; - mCDGWindow.Hide(); - } + #region "CDG Graphics Window" - #endregion + private void ShowCDGWindow() + { + mCDGWindow.Show(); + } + private void HideCDGWindow() + { + mCDGWindow.pbLyrics.Image = null; + mCDGWindow.Hide(); + } - - - - - - - - - - - - - - - - - - - - - } -} + #endregion + } +} \ No newline at end of file diff --git a/KaraokePlayer/KaraokePlayer.csproj b/KaraokePlayer/KaraokePlayer.csproj index 35af766..16bf6c8 100644 --- a/KaraokePlayer/KaraokePlayer.csproj +++ b/KaraokePlayer/KaraokePlayer.csproj @@ -42,6 +42,7 @@ + @@ -51,6 +52,18 @@ + + ..\packages\Vlc.DotNet.Core.2.1.115\lib\net45\x86\Vlc.DotNet.Core.dll + True + + + ..\packages\Vlc.DotNet.Core.Interops.2.1.115\lib\net45\x86\Vlc.DotNet.Core.Interops.dll + True + + + ..\packages\Vlc.DotNet.Forms.2.1.115\lib\net45\x86\Vlc.DotNet.Forms.dll + True + @@ -65,9 +78,15 @@ Form1.cs + + Form + + + CDGWindow.cs + Form1.cs @@ -79,6 +98,7 @@ True Resources.resx + True @@ -98,6 +118,26 @@ + + + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + aximp + False + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + tlbimp + False + True + diff --git a/KaraokePlayer/PlexiGlass.cs b/KaraokePlayer/PlexiGlass.cs new file mode 100644 index 0000000..a0cb08b --- /dev/null +++ b/KaraokePlayer/PlexiGlass.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KaraokePlayer +{ + using System; + using System.Drawing; + using System.Windows.Forms; + using System.Runtime.InteropServices; + + class Plexiglass : Form + { + public Plexiglass(Form tocover) + { + this.BackColor = Color.FromArgb(1,1,1); + TransparencyKey = Color.FromArgb(1, 1, 1); + this.FormBorderStyle = FormBorderStyle.None; + this.ControlBox = false; + this.ShowInTaskbar = false; + this.StartPosition = FormStartPosition.Manual; + this.AutoScaleMode = AutoScaleMode.None; + this.Location = tocover.PointToScreen(Point.Empty); + this.ClientSize = tocover.ClientSize; + tocover.LocationChanged += Cover_LocationChanged; + tocover.ClientSizeChanged += Cover_ClientSizeChanged; + this.Show(tocover); + tocover.Focus(); + // Disable Aero transitions, the plexiglass gets too visible + if (Environment.OSVersion.Version.Major >= 6) + { + int value = 1; + DwmSetWindowAttribute(tocover.Handle, DWMWA_TRANSITIONS_FORCEDISABLED, ref value, 4); + } + } + private void Cover_LocationChanged(object sender, EventArgs e) + { + // Ensure the plexiglass follows the owner + this.Location = this.Owner.PointToScreen(Point.Empty); + } + private void Cover_ClientSizeChanged(object sender, EventArgs e) + { + // Ensure the plexiglass keeps the owner covered + this.ClientSize = this.Owner.ClientSize; + } + protected override void OnFormClosing(FormClosingEventArgs e) + { + // Restore owner + this.Owner.LocationChanged -= Cover_LocationChanged; + this.Owner.ClientSizeChanged -= Cover_ClientSizeChanged; + if (!this.Owner.IsDisposed && Environment.OSVersion.Version.Major >= 6) + { + int value = 1; + DwmSetWindowAttribute(this.Owner.Handle, DWMWA_TRANSITIONS_FORCEDISABLED, ref value, 4); + } + base.OnFormClosing(e); + } + protected override void OnActivated(EventArgs e) + { + // Always keep the owner activated instead + this.BeginInvoke(new Action(() => this.Owner.Activate())); + } + private const int DWMWA_TRANSITIONS_FORCEDISABLED = 3; + [DllImport("dwmapi.dll")] + private static extern int DwmSetWindowAttribute(IntPtr hWnd, int attr, ref int value, int attrLen); + } +} diff --git a/KaraokePlayer/Program.cs b/KaraokePlayer/Program.cs index 679fd73..47916b0 100644 --- a/KaraokePlayer/Program.cs +++ b/KaraokePlayer/Program.cs @@ -1,22 +1,19 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; namespace KaraokePlayer { - static class Program + internal static class Program { /// - /// The main entry point for the application. + /// The main entry point for the application. /// [STAThread] - static void Main() + private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } -} +} \ No newline at end of file diff --git a/KaraokePlayer/Properties/AssemblyInfo.cs b/KaraokePlayer/Properties/AssemblyInfo.cs index f18900a..e15ce1c 100644 --- a/KaraokePlayer/Properties/AssemblyInfo.cs +++ b/KaraokePlayer/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. + [assembly: AssemblyTitle("KaraokePlayer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -17,9 +17,11 @@ using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM + [assembly: Guid("2cf318e2-04b5-40fc-9577-6dac62b86fb2")] // Version information for an assembly consists of the following four values: @@ -32,5 +34,6 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] + [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/KaraokePlayer/Properties/Resources.Designer.cs b/KaraokePlayer/Properties/Resources.Designer.cs index 0c5990a..42007bd 100644 --- a/KaraokePlayer/Properties/Resources.Designer.cs +++ b/KaraokePlayer/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace KaraokePlayer.Properties -{ - - +namespace KaraokePlayer.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -22,50 +22,52 @@ namespace KaraokePlayer.Properties [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KaraokePlayer.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Google { + get { + object obj = ResourceManager.GetObject("Google", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/KaraokePlayer/Properties/Resources.resx b/KaraokePlayer/Properties/Resources.resx index af7dbeb..ee4e93d 100644 --- a/KaraokePlayer/Properties/Resources.resx +++ b/KaraokePlayer/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\Google.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/KaraokePlayer/Properties/Settings.settings b/KaraokePlayer/Properties/Settings.settings index 3964565..e04fc63 100644 --- a/KaraokePlayer/Properties/Settings.settings +++ b/KaraokePlayer/Properties/Settings.settings @@ -1,7 +1,8 @@  + - + \ No newline at end of file diff --git a/KaraokePlayer/Resources/Google.png b/KaraokePlayer/Resources/Google.png new file mode 100644 index 0000000..4cd9cd9 Binary files /dev/null and b/KaraokePlayer/Resources/Google.png differ diff --git a/KaraokePlayer/Unzip.cs b/KaraokePlayer/Unzip.cs index 7379a3d..3a96aa8 100644 --- a/KaraokePlayer/Unzip.cs +++ b/KaraokePlayer/Unzip.cs @@ -1,25 +1,21 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ICSharpCode.SharpZipLib.Zip; namespace KaraokePlayer { - class Unzip + internal class Unzip { - public static string UnzipMP3GFiles(string zipFilename, string outputPath) { string functionReturnValue = null; functionReturnValue = ""; try { - ICSharpCode.SharpZipLib.Zip.FastZip myZip = new ICSharpCode.SharpZipLib.Zip.FastZip(); + var myZip = new FastZip(); myZip.ExtractZip(zipFilename, outputPath, ""); - DirectoryInfo myDirInfo = new DirectoryInfo(outputPath); - FileInfo[] myFileInfo = myDirInfo.GetFiles("*.cdg", SearchOption.AllDirectories); + var myDirInfo = new DirectoryInfo(outputPath); + var myFileInfo = myDirInfo.GetFiles("*.cdg", SearchOption.AllDirectories); if (myFileInfo.Length > 0) { functionReturnValue = myFileInfo[0].FullName; @@ -30,6 +26,5 @@ namespace KaraokePlayer } return functionReturnValue; } - } -} +} \ No newline at end of file diff --git a/KaraokePlayer/packages.config b/KaraokePlayer/packages.config index 273ff53..08c7285 100644 --- a/KaraokePlayer/packages.config +++ b/KaraokePlayer/packages.config @@ -1,4 +1,7 @@  + + + \ No newline at end of file diff --git a/VlcPlayer/Properties/AssemblyInfo.cs b/VlcPlayer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..66590c4 --- /dev/null +++ b/VlcPlayer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VlcPlayer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VlcPlayer")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4daaf531-4269-4548-b4e3-516254615ec1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VlcPlayer/VlcControl.Designer.cs b/VlcPlayer/VlcControl.Designer.cs new file mode 100644 index 0000000..63c9f5d --- /dev/null +++ b/VlcPlayer/VlcControl.Designer.cs @@ -0,0 +1,63 @@ +namespace VlcPlayer +{ + partial class VlcControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VlcControl)); + this.axVLCPlugin21 = new AxAXVLC.AxVLCPlugin2(); + ((System.ComponentModel.ISupportInitialize)(this.axVLCPlugin21)).BeginInit(); + this.SuspendLayout(); + // + // axVLCPlugin21 + // + this.axVLCPlugin21.AccessibleRole = System.Windows.Forms.AccessibleRole.Document; + this.axVLCPlugin21.Dock = System.Windows.Forms.DockStyle.Fill; + this.axVLCPlugin21.Enabled = true; + this.axVLCPlugin21.Location = new System.Drawing.Point(0, 0); + this.axVLCPlugin21.Name = "axVLCPlugin21"; + this.axVLCPlugin21.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axVLCPlugin21.OcxState"))); + this.axVLCPlugin21.Size = new System.Drawing.Size(473, 315); + this.axVLCPlugin21.TabIndex = 0; + // + // VlcControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.axVLCPlugin21); + this.Name = "VlcControl"; + this.Size = new System.Drawing.Size(473, 315); + ((System.ComponentModel.ISupportInitialize)(this.axVLCPlugin21)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + public AxAXVLC.AxVLCPlugin2 axVLCPlugin21; + } +} diff --git a/VlcPlayer/VlcControl.cs b/VlcPlayer/VlcControl.cs new file mode 100644 index 0000000..e971f36 --- /dev/null +++ b/VlcPlayer/VlcControl.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace VlcPlayer +{ + public partial class VlcControl : UserControl + { + public VlcControl() + { + InitializeComponent(); + } + } +} diff --git a/VlcPlayer/VlcControl.resx b/VlcPlayer/VlcControl.resx new file mode 100644 index 0000000..eef510b --- /dev/null +++ b/VlcPlayer/VlcControl.resx @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAgwEAAAIB + AAAAAQAAAAAAAAAAAAAAAG4BAAAHAAAAKABDAG8AdQBuAHQAKQADAA0AAAAIAAAAQQB1AHQAbwBMAG8A + bwBwAAsAAAAIAAAAQQB1AHQAbwBQAGwAYQB5AAsA//8JAAAAQgBhAGMAawBDAG8AbABvAHIAAwAAAAAA + BwAAAEIAYQBzAGUAVQBSAEwACAAAAAAACAAAAEIAcgBhAG4AZABpAG4AZwALAP//DAAAAEUAeAB0AGUA + bgB0AEgAZQBpAGcAaAB0AAMAjiAAAAsAAABFAHgAdABlAG4AdABXAGkAZAB0AGgAAwDjMAAAEQAAAEYA + dQBsAGwAcwBjAHIAZQBlAG4ARQBuAGEAYgBsAGUAZAALAP//AwAAAE0AUgBMAAgAAAAAAAkAAABTAHQA + YQByAHQAVABpAG0AZQADAAAAAAAHAAAAVABvAG8AbABiAGEAcgALAP//BwAAAFYAaQBzAGkAYgBsAGUA + CwD//wYAAABWAG8AbAB1AG0AZQADADIAAAAL + + + \ No newline at end of file diff --git a/VlcPlayer/VlcPlayer.csproj b/VlcPlayer/VlcPlayer.csproj new file mode 100644 index 0000000..6835e23 --- /dev/null +++ b/VlcPlayer/VlcPlayer.csproj @@ -0,0 +1,86 @@ + + + + + Debug + AnyCPU + {4DAAF531-4269-4548-B4E3-516254615EC1} + Library + Properties + VlcPlayer + VlcPlayer + v4.6 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + UserControl + + + VlcControl.cs + + + + + VlcControl.cs + + + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + aximp + False + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + tlbimp + False + True + + + + + \ No newline at end of file diff --git a/WpfKaraokePlayer/App.config b/WpfKaraokePlayer/App.config new file mode 100644 index 0000000..8324aa6 --- /dev/null +++ b/WpfKaraokePlayer/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WpfKaraokePlayer/App.xaml b/WpfKaraokePlayer/App.xaml new file mode 100644 index 0000000..b22fd3f --- /dev/null +++ b/WpfKaraokePlayer/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WpfKaraokePlayer/App.xaml.cs b/WpfKaraokePlayer/App.xaml.cs new file mode 100644 index 0000000..c9f466f --- /dev/null +++ b/WpfKaraokePlayer/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace WpfKaraokePlayer +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/WpfKaraokePlayer/MainWindow.xaml b/WpfKaraokePlayer/MainWindow.xaml new file mode 100644 index 0000000..496356f --- /dev/null +++ b/WpfKaraokePlayer/MainWindow.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/WpfKaraokePlayer/MainWindow.xaml.cs b/WpfKaraokePlayer/MainWindow.xaml.cs new file mode 100644 index 0000000..74889f9 --- /dev/null +++ b/WpfKaraokePlayer/MainWindow.xaml.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Forms.Integration; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + + +namespace WpfKaraokePlayer +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private AxAXVLC.AxVLCPlugin2 _vlcPlayer; + public MainWindow() + { + InitializeComponent(); + var _vlcPlayer = new VlcControl(); + vlcHost.Child = _vlcPlayer; + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + image.Source = new BitmapImage(new Uri(@"C:\Users\l-bre\Desktop\ares2.png", UriKind.Absolute)); + + } + } +} diff --git a/WpfKaraokePlayer/Properties/AssemblyInfo.cs b/WpfKaraokePlayer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a268cf8 --- /dev/null +++ b/WpfKaraokePlayer/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WpfKaraokePlayer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WpfKaraokePlayer")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WpfKaraokePlayer/Properties/Resources.Designer.cs b/WpfKaraokePlayer/Properties/Resources.Designer.cs new file mode 100644 index 0000000..226d99e --- /dev/null +++ b/WpfKaraokePlayer/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WpfKaraokePlayer.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfKaraokePlayer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/WpfKaraokePlayer/Properties/Resources.resx b/WpfKaraokePlayer/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/WpfKaraokePlayer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WpfKaraokePlayer/Properties/Settings.Designer.cs b/WpfKaraokePlayer/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a649c87 --- /dev/null +++ b/WpfKaraokePlayer/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WpfKaraokePlayer.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/WpfKaraokePlayer/Properties/Settings.settings b/WpfKaraokePlayer/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/WpfKaraokePlayer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/WpfKaraokePlayer/VlcControl.Designer.cs b/WpfKaraokePlayer/VlcControl.Designer.cs new file mode 100644 index 0000000..6db19ac --- /dev/null +++ b/WpfKaraokePlayer/VlcControl.Designer.cs @@ -0,0 +1,61 @@ +namespace WpfKaraokePlayer +{ + partial class VlcControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VlcControl)); + this.vlcPlayer = new AxAXVLC.AxVLCPlugin2(); + ((System.ComponentModel.ISupportInitialize)(this.vlcPlayer)).BeginInit(); + this.SuspendLayout(); + // + // vlcPlayer + // + this.vlcPlayer.Dock = System.Windows.Forms.DockStyle.Fill; + this.vlcPlayer.Enabled = true; + this.vlcPlayer.Location = new System.Drawing.Point(0, 0); + this.vlcPlayer.Name = "vlcPlayer"; + this.vlcPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("vlcPlayer.OcxState"))); + this.vlcPlayer.Size = new System.Drawing.Size(150, 150); + this.vlcPlayer.TabIndex = 0; + // + // VlcControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.vlcPlayer); + this.Name = "VlcControl"; + ((System.ComponentModel.ISupportInitialize)(this.vlcPlayer)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private AxAXVLC.AxVLCPlugin2 vlcPlayer; + } +} diff --git a/WpfKaraokePlayer/VlcControl.cs b/WpfKaraokePlayer/VlcControl.cs new file mode 100644 index 0000000..4401626 --- /dev/null +++ b/WpfKaraokePlayer/VlcControl.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WpfKaraokePlayer +{ + public partial class VlcControl : UserControl + { + public VlcControl() + { + InitializeComponent(); + } + } +} diff --git a/WpfKaraokePlayer/VlcControl.resx b/WpfKaraokePlayer/VlcControl.resx new file mode 100644 index 0000000..8cba96c --- /dev/null +++ b/WpfKaraokePlayer/VlcControl.resx @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAgwEAAAIB + AAAAAQAAAAAAAAAAAAAAAG4BAAAHAAAAKABDAG8AdQBuAHQAKQADAA0AAAAIAAAAQQB1AHQAbwBMAG8A + bwBwAAsAAAAIAAAAQQB1AHQAbwBQAGwAYQB5AAsA//8JAAAAQgBhAGMAawBDAG8AbABvAHIAAwAAAAAA + BwAAAEIAYQBzAGUAVQBSAEwACAAAAAAACAAAAEIAcgBhAG4AZABpAG4AZwALAP//DAAAAEUAeAB0AGUA + bgB0AEgAZQBpAGcAaAB0AAMAgQ8AAAsAAABFAHgAdABlAG4AdABXAGkAZAB0AGgAAwCBDwAAEQAAAEYA + dQBsAGwAcwBjAHIAZQBlAG4ARQBuAGEAYgBsAGUAZAALAP//AwAAAE0AUgBMAAgAAAAAAAkAAABTAHQA + YQByAHQAVABpAG0AZQADAAAAAAAHAAAAVABvAG8AbABiAGEAcgALAP//BwAAAFYAaQBzAGkAYgBsAGUA + CwD//wYAAABWAG8AbAB1AG0AZQADADIAAAAL + + + \ No newline at end of file diff --git a/WpfKaraokePlayer/WpfKaraokePlayer.csproj b/WpfKaraokePlayer/WpfKaraokePlayer.csproj new file mode 100644 index 0000000..b51889a --- /dev/null +++ b/WpfKaraokePlayer/WpfKaraokePlayer.csproj @@ -0,0 +1,138 @@ + + + + + Debug + AnyCPU + {2B5657F5-A063-4E44-A953-E7C84D93C317} + WinExe + Properties + WpfKaraokePlayer + WpfKaraokePlayer + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + 4.0 + + + + + + + + + + MSBuild:Compile + Designer + + + UserControl + + + VlcControl.cs + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + VlcControl.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + aximp + False + + + {DF2BBE39-40A8-433B-A279-073F48DA94B6} + 1 + 0 + 0 + tlbimp + False + True + + + + + \ No newline at end of file diff --git a/msvcr90.dll b/msvcr90.dll new file mode 100644 index 0000000..072bc0b Binary files /dev/null and b/msvcr90.dll differ