卡拉ok的播放器播放器,买了一台,老婆不喜欢,...

当前位置: &
> MvBox卡拉OK播放器 v6.1.0.4 官方最新版
MvBox卡拉OK播放器 v6.1.0.4 官方最新版
软件大小:46.4MB
软件语言:简体中文
软件类型:国产软件
授权方式:免费版
更新时间:
软件分类:
软件官网:
用户评分:
运行环境:WinXP/Win7/Win8/
MvBox卡拉OK播放器是一款功能强大的多媒体卡拉OK播放软件,它具有最新、最快、最全的高音质流行歌曲和丰富的网络原创歌曲KTV资源, 通过它您不仅可以在线听歌、K歌,还可以高质量的录制自己的卡拉OK歌曲和有清晰画面的MTV;同时MVBOX还给您提供了强大的虚拟视频功能!是国内最受欢迎的卡拉OK播放器和虚拟视频软件。
MvBox播放器功能特点:
1.强大的点歌卡拉OK功能,支持原唱伴奏任意切换;
2.超大歌词库,支持3万首歌曲的卡拉OK字幕显示;
3.超强背景功能:网友可以把自己喜欢的图片和视频素材做背景,制作自己的MTV,图片背景特效支持上百种效果;
4.录音录像功能:支持在所有背景下合成字幕录像,支持对演唱进行录音;
5.支持虚拟视频功能:网友可以用MVBOX在任何聊天软件(UC、QQ、MSN、E话通、碧聊等等)里面唱歌供大家欣赏各种特效;
6.屏幕捕获功能:结合虚拟视频方便进行网络演示;
7.支持画中画效果:网友可以把自己的摄像头和视频、图片合成,形成画中画的特效;
8.开放字幕制作工具:为原创歌手提供制作自己歌曲的平台,并支持上传发布给其他的网友分享。
9.强大的媒体库收集网友的图片、视频、歌曲和作品,利用他可以方便的收藏、加栽自己的素材;
10.大头贴功能:提供许多大头贴前景特效功能,让你的视频效果更出色。
MVBOX VIP去广告绿色版:
41.9M | 简体中文
17.5M | 简体中文
13.2M | 简体中文
41.7M | 简体中文
17.4M | 简体中文
10.2M | 简体中文
31.5M | 简体中文
17.9M | 多国语言
31.0M | 简体中文
电脑K歌软件
共收集21款软件
电脑K歌软件排行榜大全。电脑K歌软件其实就是是免费的电脑录音软件,把您自己的歌声融入在软件提供的伴奏中,之后可以用软件进行免费的卡拉音频效果处理和ok音频编辑,比如背景噪音处理、音频数据编辑、混音设置等。K歌软件让你足不出户就可以尽情k歌、练歌,一展歌喉 ,网上ktv,与来自五湖四海的朋友互动演唱,赶快下载体验吧!
下载错误?
MvBox卡拉OK播放器 v6.1.0.4 官方最新版
下载地址:
大家都喜欢
注:您的评论需要经过审核才能显示哦,请文明发言!
多媒体分类
媒体播放排行
共收集21款软件
本站资源均收集整理于互联网,其著作权归原作者所有,如果有侵犯您权利的资源,请来信告知,我们将及时撤销相应资源。
Copy . All Rights Reserved.2776人阅读
学生时代做的一个非常低级的C#卡拉OK播放器。
实现了桌面卡拉OK[单行,双行],繁简转换,歌曲搜索,3种播放模式[单首,循环,随机],全屏歌词,全局快捷键,XML配置,指定歌词文件夹,等等一些简单的功能。
无意中翻出来了,看看,听听歌,有别有一番乐趣,想当初做这个的时候才接触编程1年。里面用了太多的集合,歌词判断也非常不准备。呵呵。算是用一种非常笨的方法实现的吧。里面没什么高深的技术。主要就是用到了双缓冲[一种防止歌词刷新时屏幕闪烁的技术]、注册全局快捷键等。
已经好久没有接触C#了,虽然这是曾经非常感兴趣的东西,却为了学习编程思想选择了JAVA。如果现在再让我做,我一定会把里面的代码简化简化再简化吧。看着那些乱七八糟的代码,想想自己当年的何其的菜鸟水平的作品。也是一种人生的乐趣。
窗体卡拉OK
桌面卡拉OK显示[支持单行,双行]:
歌词配置[当时我还没有学XML,实现来源于网上]:
&configuration&
&appSettings&
&add key=&lrcDir& value=&E:\music\AIRPLAY.DAT\Lyrics& /&
&add key=&playState& value=&2& /&
&add key=&sound& value=&28& /&
&add key=&DeskIsDoubleline& value=&true& /&
&add key=&DeskFontFamily& value=&英章楷书& /&
&add key=&DeskFontSize& value=&27.75& /&
&add key=&DeskFontStyle& value=&bold& /&
&add key=&DeskNormalColor& value=&-65536& /&
&add key=&DeskLightColor& value=&-& /&
&add key=&FontSize& value=&15& /&
&add key=&NormalColor& value=&-4144960& /&
&add key=&LightColor& value=&-& /&
&add key=&BackColor& value=&-& /&
&add key=&FontStyle& value=&bold& /&
&add key=&FontFamily& value=&英章楷书& /&
&add key=&DeskBackColor& value=&-& /&
&/appSettings&
&/configuration&
读取配置文件的核心处理类:
using System.Collections.G
using System.T
using System.X
namespace LrcCollection
internal class Config
public static string GetValue(string AppKey)
XmlDocument document = new XmlDocument();
document.Load(System.AppDomain.CurrentDomain.BaseDirectory + &LrcSet.xml&);
XmlElement element = (XmlElement)document.SelectSingleNode(&//appSettings&).SelectSingleNode(&//add[@key='& + AppKey + &']&);
if (element != null)
return element.GetAttribute(&value&);
public static void SetValue(string AppKey, string AppValue)
XmlDocument document = new XmlDocument();
document.Load(System.AppDomain.CurrentDomain.BaseDirectory + &LrcSet.xml&);
XmlNode node = document.SelectSingleNode(&//appSettings&);
XmlElement element = (XmlElement)node.SelectSingleNode(&//add[@key='& + AppKey + &']&);
if (element != null)
element.SetAttribute(&value&, AppValue);
XmlElement newChild = document.CreateElement(&add&);
newChild.SetAttribute(&key&, AppKey);
newChild.SetAttribute(&value&, AppValue);
node.AppendChild(newChild);
document.Save(System.AppDomain.CurrentDomain.BaseDirectory + &LrcSet.xml&);
SetValue(AppKey, AppValue, true);
public static void SetValue(string AppKey, string AppValue, bool tt)
XmlDocument document = new XmlDocument();
XmlNode node = document.CreateNode(XmlNodeType.Element, &configuration&, &&);
document.AppendChild(node);
XmlNode node2 = document.CreateNode(XmlNodeType.Element, &appSettings&, &&);
node.AppendChild(node2);
XmlElement newChild = document.CreateElement(&add&);
newChild.SetAttribute(&key&, AppKey);
newChild.SetAttribute(&value&, AppValue);
node2.AppendChild(newChild);
document.Save(System.AppDomain.CurrentDomain.BaseDirectory + &LrcSet.xml&);
下面是画歌词的处理类[现在自己都看不懂当初是如何实现的了,贴在这里吧。]:
说一说主要的思想:
画歌词的面板一定要继承UserControl类,然后重写其protected override void OnPaint(PaintEventArgs pe)方法,实现双缓冲,在这里面画歌词。
画卡拉OK歌词的原理是:先画背景[底层],再画你要显示的所有歌词[中间层],每行歌词都是顺序向下的,中间有间距,然后再你画好的歌词上面,画卡拉OK歌词,也就是高亮显示的那一行歌词[最上层],这一行歌词会覆盖之前画的中间层歌词的那一行,当然这样它还不是卡拉OK显示的,卡拉OK显示就要取出当前这句歌词和下一句歌词之间的时间,然后从左至右,匀速的画上高亮显示的这一行,看起来就是卡拉OK显示出来了。像酷狗这种歌词是经过精准处理的。
桌面歌词就很简单了,主要是一个无标题的窗体,做上鼠标移动事件即可拖动,单行,双行歌词也只不过是多了一层判断。双行就是每次唱完一句就取出下一句画在面板上。单行就是唱一句画一句。
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Windows.F
using System.Drawing.T
using System.Drawing.Drawing2D;
using System.IO;
using System.Runtime.Serialization.Formatters.B
using System.C
using LrcC
namespace MediaPlayer
public partial class DeskLrcControl : UserControl
public DeskLrcControl()
InitializeComponent();
Size1(this.Size);
Components();
this.DoubleBuffered =
#region 字段
public LrcPanel lrcPanel =
private ArrayList lrcConfig = new ArrayList();
int width = 0;
Bitmap imgB
Bitmap imgL
int middleTime = 0;
public string currentPosition =
public Dictionary&int, string& lrcSortedList = new Dictionary&int, string&();//用来保存歌词和时间排序后的集合
private SolidBrush backB
private SolidBrush lightB
private Color backC
private Font fontS
private StringFormat stringF
[Description(&普通歌词颜色&), Category(&歌词样式设置&)]
public SolidBrush BackBrush
get { return backB }
set { backBrush = }
[Description(&高亮歌词颜色&), Category(&歌词样式设置&)]
public SolidBrush LightBrush
get { return lightB }
set { lightBrush = }
[Description(&歌词背景颜色&), Category(&歌词样式设置&)]
public Color BackColors
get { return backC }
set { backColor = }
[Description(&当前歌曲时间&), Category(&歌词样式设置&)]
public string CurrentPosition
get { return currentP }
set { currentPosition = }
[Description(&歌词字体样式&), Category(&歌词样式设置&)]
public Font FontSty
get { return fontS }
set { fontStyle = }
[Description(&歌词字体排序&), Category(&歌词样式设置&)]
public StringFormat StringFormatter
get { return stringF }
set { stringFormatter = }
public override Color BackColor
return backC
base.BackColor =
public void Size1(Size s)
if (imgBack != null)
imgBack.Dispose();
if (imgLrc != null)
imgLrc.Dispose();
imgBack = new Bitmap(s.Width, s.Height);
imgLrc = new Bitmap(s.Width, s.Height);
//maxWidth = 0;
//lrcSortedList.Clear();
//Graphics g = Graphics.FromHwnd(this.contextMenuStrip1.Handle);
//for (int i = 0; i & tempTime.L i++)
if (i + 1 & tempTime.Length)
if (g.MeasureString(lrcList.ElementAt(i).Value, fontStyle).Width & maxWidth)
maxWidth = (int)g.MeasureString(lrcList.ElementAt(i).Value, fontStyle).W
lrcSortedList.Add(tempTime[i], lrcList[tempTime[i]]);
//g.Dispose();
//imgBack = new Bitmap(maxWidth + 2, this.Height);
//imgLrc = new Bitmap(maxWidth + 2, this.Height);
//this.Refresh();
public override Size MinimumSize
return new Size(200, 20);
base.MinimumSize =
#endregion
protected override void OnPaint(PaintEventArgs pe)
if (currentPosition != null)
if (load == false)
Components();
DrawString(currentPosition, pe.Graphics, BackBrush, LightBrush, this.fontStyle, this.BackColor, stringFormatter);
pe.Dispose();
bool load =
#region //初始化
public void Components()
backBrush = new SolidBrush(Color.FromArgb(Convert.ToInt32(Config.GetValue(&DeskNormalColor&))));
lightBrush = new SolidBrush(Color.FromArgb(Convert.ToInt32(Config.GetValue(&DeskLightColor&))));
backColor = Color.FromArgb(Convert.ToInt32(Config.GetValue(&DeskBackColor&)));
FontStyle f = FontStyle.R
if (Config.GetValue(&DeskFontStyle&) == &bold&)
f = FontStyle.B
else if (Config.GetValue(&DeskFontStyle&) == &italic&)
f = FontStyle.I
else if (Config.GetValue(&DeskFontStyle&) == &strikeout&)
f = FontStyle.S
else if (Config.GetValue(&DeskFontStyle&) == &underline&)
f = FontStyle.U
f = FontStyle.R
fontStyle = new Font(Config.GetValue(&DeskFontFamily&), float.Parse(Config.GetValue(&DeskFontSize&)),f);
if (Config.GetValue(&DeskIsDoubleline&) != null)
isDoubleLine = Convert.ToBoolean(Config.GetValue(&DeskIsDoubleline&));
stringFormatter = new StringFormat();
stringFormatter.Alignment = StringAlignment.C
stringFormatter.LineAlignment = StringAlignment.C
stringFormatter.Trimming = StringTrimming.C
backBrush = new SolidBrush(Color.Blue);
lightBrush = new SolidBrush(Color.Red);
backColor = Color.B
fontStyle = new Font(&幼圆&, 34f);
stringFormatter = new StringFormat();
stringFormatter.Alignment = StringAlignment.C
stringFormatter.LineAlignment = StringAlignment.C
stringFormatter.Trimming = StringTrimming.C
#endregion
#region 画歌词
public bool isKana =
public bool isTranKey =
public bool isDoubleLine =
SizeF imgSize = SizeF.E
SizeF img1 = SizeF.E
public string DrawString(string nowTime, Graphics g, SolidBrush backBrush, SolidBrush lightBrush, Font f, Color backColor, StringFormat format)
if (isTranKey == true)
this.BackColors = Color.T
this.FindForm().BackColor = Color.T
this.FindForm().TransparencyKey = Color.T
if (lrcSortedList.Count & 0 && LrcConnections.lrcPath != null)
Size1(this.FindForm().Size);//歌词居中
imgLrc = DrawLrcImg(nowTime, lightBrush, backBrush, f, backColor, format);
if (isKana == true)
imgBack = ShowLrc(backBrush, f, backColor, format);//画背景歌词
g.CompositingQuality = CompositingQuality.HighQ
g.SmoothingMode = SmoothingMode.AntiA
g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridF
if (imgLrc != null && imgBack != null)
Rectangle rec = new Rectangle(0, 0, width, this.imgLrc.Height);
g.DrawImage(imgBack, 0, 0);
//画当前高亮显示的歌词,其实就是画歌词图像的一部分,以像素显示会呈现卡拉OK歌词
g.DrawImage(imgLrc, 0, 0, rec, GraphicsUnit.Pixel);
//g.Flush();
else if (imgLrc != null)
g.DrawImage(imgLrc, 0, 0);
//g.Flush();
if (LrcConnections.lrcPath == null)
Graphics gg = Graphics.FromImage(imgBack);
gg.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridF
gg.CompositingQuality = CompositingQuality.HighQ
gg.SmoothingMode = SmoothingMode.AntiA
SizeF imgSize = gg.MeasureString(&对不起,没有找到歌词,您可以手动指定歌词&, f);//当前歌词长度
this.FindForm().Size = new Size((int)imgSize.Width, (int)imgSize.Height);
Size1(this.Size);
gg.Dispose();
gg = Graphics.FromImage(imgBack);
gg.DrawString(&对不起,没有找到歌词,您可以手动指定歌词&, f, backBrush, 0, 0);
gg.Dispose();
g.DrawImage(imgBack, 0, 0);
#endregion
#region 显示高亮歌词的方法
private Bitmap DrawLrcImg(string currentTime, SolidBrush lightBrush, SolidBrush backBrush, Font f, Color backColor, StringFormat format)
if (currentTime == && || currentTime == null)
if (imgLrc == null)
Graphics gra = Graphics.FromImage(imgLrc);
gra.Clear(backColor);
minute = Convert.ToInt32(currentTime.Substring(0, 2)) * 60;//分钟转为秒
second = Convert.ToInt32(currentTime.Substring(3));
for (int i = 0; i & lrcSortedList.Count - 1; i++)
if (lrcSortedList.ElementAt(i).Key == (minute + second))//高亮显示当前歌词
//float lrcWidth = g.MeasureString(lrcSortedList.ElementAt(i).Value, f).W
UserHelper.currentLrcIndex =
width = 0;
if ((UserHelper.currentLrcIndex + 1) &= lrcSortedList.Count)
middleTime = lrcSortedList.ElementAt(UserHelper.currentLrcIndex + 1).Key - lrcSortedList.ElementAt(UserHelper.currentLrcIndex).K
imgSize = gra.MeasureString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f);//当前歌词长度
if (isDoubleLine == false)
this.FindForm().Size = new Size((int)imgSize.Width, (int)imgSize.Height);
Size1(this.Size);
else//如果是双行的话
if (UserHelper.currentLrcIndex & lrcSortedList.Count - 1)
img1 = gra.MeasureString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex + 1).Value, f);
if (imgSize.Width & img1.Width)
this.FindForm().Size = new Size((int)imgSize.Width, (int)imgSize.Height * 2);
Size1(this.Size);
this.FindForm().Size = new Size((int)img1.Width, (int)img1.Height * 2);
Size1(this.Size);
gra.Dispose();
if (width == 0)
width += (int)(imgSize.Width / (middleTime * 6));//歌词匀速以卡拉OK形式前进,毫秒化为秒
Graphics g = Graphics.FromImage(imgLrc);
g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridF
g.CompositingQuality = CompositingQuality.HighQ
g.SmoothingMode = SmoothingMode.AntiA
if (isDoubleLine == false)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f, lightBrush, 0, 0);
if (UserHelper.currentLrcIndex % 2 == 0)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f, lightBrush, 0, 0);
if (UserHelper.currentLrcIndex & lrcSortedList.Count - 1)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex + 1).Value, f, backBrush, 0, f.Height);
if (UserHelper.currentLrcIndex & lrcSortedList.Count - 1)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex + 1).Value, f, backBrush, 0, 0);
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f, lightBrush, 0, f.Height);
//g.Flush();
g.Dispose();
return imgL
#endregion
#region 显示背景歌词的方法
public Bitmap ShowLrc(SolidBrush backBrush, Font f, Color backColor, StringFormat format)
Graphics gra = Graphics.FromImage(imgBack);
gra.Clear(backColor);
//Font f1 = new Font(f.FontFamily, f.Size + 0.2f, FontStyle.Regular);
//for (int index = 0; index & lrcSortedList.Count - 1; index++)
Graphics g = Graphics.FromImage(imgBack);
g.SmoothingMode = SmoothingMode.AntiA
g.DrawString(lrcSortedList.ElementAt(index).Value, f1, new SolidBrush(Color.Blue), this.imgBack.Width / 2, f.Height * (index + space + 1 + lines), format);
g.Dispose();
//f1.Dispose();
//显示歌词
Graphics g = Graphics.FromImage(imgBack);
g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridF
g.CompositingQuality = CompositingQuality.HighQ
g.SmoothingMode = SmoothingMode.AntiA
if (isDoubleLine == false)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f, backBrush, 0, 0);
if (UserHelper.currentLrcIndex % 2 == 0)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f, backBrush, 0, 0);
if (UserHelper.currentLrcIndex & lrcSortedList.Count - 1)
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex + 1).Value, f, backBrush, 0, f.Height);
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex + 1).Value, f, backBrush, 0, 0);
g.DrawString(lrcSortedList.ElementAt(UserHelper.currentLrcIndex).Value, f, backBrush, 0, f.Height);
//g.Flush();
g.Dispose();
return imgB
#endregion
歌词繁简转换也很容易:
/// &summary&
/// 简体到繁体转换
/// &/summary&
/// &param name=&simplifiedChinese&&简体&/param&
/// &returns&繁体&/returns&
private string SimplifiedToTraditional(string simplifiedChinese)
string traditionalChinese = string.E
System.Globalization.CultureInfo vCultureInfo = new System.Globalization.CultureInfo(&zh-CN&, false);
traditionalChinese = Microsoft.VisualBasic.Strings.StrConv(simplifiedChinese, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, vCultureInfo.LCID);
return traditionalC
/// &summary&
/// 繁体到简体转换
/// &/summary&
/// &param name=&traditionalChinese&&繁体&/param&
/// &returns&简体&/returns&
private string TraditionalToSimplified(string traditionalChinese)
string simplifiedChinese = string.E
System.Globalization.CultureInfo vCultureInfo = new System.Globalization.CultureInfo(&zh-CN&, false);
simplifiedChinese = Microsoft.VisualBasic.Strings.StrConv(traditionalChinese, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, vCultureInfo.LCID);
return simplifiedC
歌词窗体出现时是动态显示的,以及全局快捷键的[当时只知道使用系统的user32.dll实现的]代码如下:
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Windows.F
using System.T
using System.Runtime.InteropS
using System.C
using System.IO;
using System.Runtime.Serialization.Formatters.B
namespace MediaPlayer
public partial class LrcFrm : Form
public AxWMPLib.AxWindowsMediaPlayer axW
public System.Windows.Forms.T
//动画窗体调用
[System.Runtime.InteropServices.DllImport(&user32&)]
private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
const int AW_HOR_POSITIVE = 0x0002;
const int AW_HOR_NEGATIVE = 0x0004;
const int AW_VER_POSITIVE = 0x0008;
const int AW_VER_NEGATIVE = 0x00016;
const int AW_CENTER = 0x0010;
const int AW_HIDE = 0x10000;
const int AW_ACTIVATE = 0x20000;
const int AW_SLIDE = 0x20000;
const int AW_BLEND = 0x80000;
public LrcFrm(AxWMPLib.AxWindowsMediaPlayer axWmplayer,System.Windows.Forms.Timer timer)
InitializeComponent();
this.DoubleBuffered =
LrcConnections.lrcfrm =
LrcConnections.lrcPanel = this.lrcPanel1;
this.axWmplayer = axW
this.timer =
#region 字段
public override Size MinimumSize
return new Size(100, 100);
base.MinimumSize =
#endregion
#region //注册热键
[DllImport(&user32.dll&, SetLastError = true)]
public static extern bool RegisterHotKey(
IntPtr hWnd, // handle to window  
int id, // hot key identifier  
KeyModifiers fsModifiers, // key-modifier options  
System.Windows.Forms.Keys vk // virtual-key code  
[DllImport(&user32.dll&, SetLastError = true)]
public static extern bool UnregisterHotKey(
IntPtr hWnd, // handle to window  
int id // hot key identifier  
public enum KeyModifiers
Control = 2,
Shift = 4,
Windows = 8
private const int WM_HOTKEY = 0x312; //窗口消息-热键
private const int WM_CREATE = 0x1; //窗口消息-创建
private const int WM_DESTROY = 0x2; //窗口消息-销毁
private const int MOD_ALT = 0x1; //ALT
private const int MOD_CONTROL = 0x2; //CTRL
private const int MOD_SHIFT = 0x4; //SHIFT
private const int VK_SPACE = 0x20; //SPACE
protected override void WndProc(ref Message m)
//base.WndProc(ref m);
switch (m.Msg)
case WM_HOTKEY: //窗口消息-热键
switch (m.WParam.ToString())
case &1989&:
this.lrcPanel1.showFullScreen();
case &11&: //热键ID
this.lrcPanel1.KanaOK();
case &12&:
this.lrcPanel1.showLrcSetFrm();
case &13&:
this.lrcPanel1.showLrc();
case &14&:
this.lrcPanel1.showFullScreen();
case &15&: //热键ID
Helper.main.PlayNext();
case &16&:
Helper.main.playPre();
//case &17&:
this.lrcPanel1.showLrc();
//case &18&:
this.lrcPanel1.showFullScreen();
case WM_CREATE: //窗口消息-创建
RegisterHotKey(this.Handle, 1989, KeyModifiers.None, Keys.Escape);
RegisterHotKey(this.Handle, 11, KeyModifiers.Control | KeyModifiers.Alt, Keys.K);
RegisterHotKey(this.Handle, 12, KeyModifiers.Control | KeyModifiers.Alt, Keys.G);
RegisterHotKey(this.Handle, 13, KeyModifiers.Control | KeyModifiers.Alt, Keys.D);
RegisterHotKey(this.Handle, 14, KeyModifiers.Control | KeyModifiers.Alt, Keys.F);
//播放控制
RegisterHotKey(this.Handle, 15, KeyModifiers.Control | KeyModifiers.Alt, Keys.Right);
RegisterHotKey(this.Handle, 16, KeyModifiers.Control | KeyModifiers.Alt, Keys.Left);
// RegisterHotKey(this.Handle, 17, KeyModifiers.Control | KeyModifiers.Alt, Keys.Up);
RegisterHotKey(this.Handle, 18, KeyModifiers.Control | KeyModifiers.Alt, Keys.Down);
case WM_DESTROY: //窗口消息-销毁
UnregisterHotKey(this.Handle, 1989);
UnregisterHotKey(this.Handle, 11); //销毁热键
UnregisterHotKey(this.Handle, 12);
UnregisterHotKey(this.Handle, 13);
UnregisterHotKey(this.Handle, 14);
UnregisterHotKey(this.Handle, 15);
UnregisterHotKey(this.Handle, 16);
UnregisterHotKey(this.Handle, 17);
// UnregisterHotKey(this.Handle, 18);
base.WndProc(ref m);
#endregion
private void LrcFrm_Load(object sender, EventArgs e)
Thread t = new Thread(loadLrc);
t.IsBackground =
t.Start();
//动画由小渐大,现在取消
AnimateWindow(this.Handle, 2000, AW_CENTER | AW_ACTIVATE);
private void loadLrc()
int i = 0;
while (LrcConnections.isReading == true)
Thread.Sleep(1000);
if (LrcConnections.isReading == false || i == 5)
if (LrcConnections.isReading == false)
this.lrcPanel1.lrcSortedList = LrcConnections.lrcSortedL
Thread.CurrentThread.Abort();
#region//改变窗体大小时
歌词面板改变
private void LrcFrm_Resize(object sender, EventArgs e)
this.lrcPanel1.Size1(this.Size);//歌词居中
this.lrcPanel1.ChangeSize();
#endregion
private void LrcFrm_FormClosing(object sender, FormClosingEventArgs e)
this.Visible =
e.Cancel =
//存储当前状态
如果你想单独试试双缓冲,可以试试这个,你可以拿它和没有使用双缓冲的timer比较下:
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Windows.F
namespace MediaPlayer
public partial class myLabel : UserControl
public myLabel()
InitializeComponent();
Timer t = new Timer();
this.DoubleBuffered =
t.Interval = 1000;
t.Tick += new EventHandler(t_Tick);
t.Enabled =
protected override void OnPaint(PaintEventArgs pe)
Draw(pe.Graphics);
pe.Dispose();
//程序人生 人生如戏 戏如人生 却不能游戏人生
void t_Tick(object sender, EventArgs e)
this.Refresh();
private void Draw(Graphics g)
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiA
Font f = new Font(&华文行楷&, 35F, FontStyle.Italic);
SolidBrush fontB = new SolidBrush(Color.Gray);
SolidBrush fontA = new SolidBrush(Color.Red);
//先画阴影,坐标偏移5
g.DrawString(&程序&, f, fontB, 15, 30);
g.DrawString(&人生&, f, fontB, 15, this.Size.Height / 2 + 15);
//再画字体
g.DrawString(&程序&, f, fontA, 0, 15);
g.DrawString(&人生&, f, fontA, 0, this.Size.Height / 2);
//Font f1 = new Font(&幼圆&, 15F, FontStyle.Regular);
//SolidBrush fontC = new SolidBrush(Color.LightGray);
//for (int i = 0; i &= 360; i += 60)
//平移Graphics对象到窗体中心
g.TranslateTransform(this.Width / 2, this.Height / 2);
//设置Graphics对象的输出角度
g.RotateTransform(i);
//设置文字填充颜色
//旋转显示文字
g.DrawString(&土豆水印&, f1, fontC, 10, 10);
//恢复全局变换矩阵
g.ResetTransform();
搜索歌词的方法,一种很笨的方法:
string song =
List&int& songIndex = new List&int&();
private void btnFind_Click(object sender, EventArgs e)
if (song != null && song != txtSong.Text.Trim())
songIndex.Clear();
song = txtSong.Text.Trim();
else if (song == null)
song = txtSong.Text.Trim();
if (song != null && song != &&)
for (int flag = 0; flag & lbPlayerList.Items.C flag++)
if (songIndex.Contains(flag))
if (lbPlayerList.Items[flag].ToString().Contains(txtSong.Text.Trim()))
songIndex.Add(flag);
lbPlayerList.SelectedIndex =
//如果到了末尾,清空集合。下次从新开始
if (flag == lbPlayerList.Items.Count - 1)
MessageBox.Show(&已经到了末尾...&);
songIndex.Clear();
如果你看到了关于窗体,你可能找不到上面显示的文字从哪来,事实上里面有2个dll文件,它描述的版本,作者,制作时间等信息,只有用特性和反射机制才可能读出来。
using System.Collections.G
using System.L
using System.T
using AttributeT
namespace AttributeReflection
/// &summary&
/// 特性,更新版本时可用反射读取此程序的信息
/// 作者,创建时间,最后修改时间,公司名称,产品名称,版本,声明
/// &/summary&
[AttibuteTuDou(&很拽の土豆&, &2009年12月&, &2011年2月&, &土豆工作室&, &雅风随风&, &1.0.0&, &CopyRight 2011 很拽の土豆 All Rights Reserved&, &以上一切信息版权归原作者所有\r\n\r\n郑重声明:版权所有,翻版不究\r\n\r\n\r\t\r\t2009.12\r\t很拽の土豆\r\nQQ:\r\n邮箱:&)]
public class Tudou
using System.Collections.G
using System.L
using System.T
namespace AttributeTudou
[AttributeUsage(AttributeTargets.All, AllowMultiple = true)]//允许多个访问,可以对任何应用程序的元素应用此特性
public class AttibuteTuDou : Attribute
public AttibuteTuDou()
public AttibuteTuDou(string author,string createDate,string lastUpDate,string comp,string producter,string version,string copyRight,string otherDesc)
this.Author =
this.CreateDate = createD
this.LastUpTime = lastUpD
this.Producter =
this.Version =
this.CopyRight = copyR
this.OtherDesc =otherD
public string Author
set { author = }
private string createD
public string CreateDate
get { return createD }
set { createDate = }
private string lastUpT
public string LastUpTime
get { return lastUpT }
set { lastUpTime = }
public string Version
set { version = }
public string Company
set { company = }
public string Producter
set { producter = }
private string otherD
public string OtherDesc
get { return otherD }
set { otherDesc = }
private string copyR
public string CopyRight
get { return copyR }
set { copyRight = }
如何读取:
如果你眼睛好,你会发现这里面还有2个方法
1个是用记事本打开歌词的,1个是定位文件[给一个路经它,它会自动在电脑上帮你定位这个文件]的。前者可能简单,但后者却更实用。
实现方法分别为:
System.Diagnostics.Process.Start(&NOTEPAD.EXE&, 文本的路径);
System.Diagnostics.Process.Start(&explorer.exe&, &/select,& + 文本的路径);
整体代码如下:
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Windows.F
using System.IO;
using System.Runtime.Serialization.Formatters.B
using LrcC
using AttributeT
using System.R
namespace MediaPlayer
public partial class LrcSetFrm : Form
//private Font fontS
private Color normalC
private Color lightC
private Color backC
private LrcPanel lrcP
public LrcSetFrm(LrcPanel lrcPanel)
InitializeComponent();
this.lrcPanel = lrcP
tudou = AssemblyT
this.Text = String.Format(&关于 {0}&, AssemblyProduct);
this.labelProductName.Text = AssemblyP
this.labelVersion.Text = String.Format(&版本 {0}&, AssemblyVersion);
this.labelCopyright.Text = AssemblyC
this.labelCompanyName.Text = AssemblyC
this.textBoxDescription.Text = AssemblyD
private void btnOpenLrc_Click(object sender, EventArgs e)
if (txtPath.Text.Trim() != && && txtPath.Text.Trim() != null)
if (File.Exists(txtPath.Text))
System.Diagnostics.Process.Start(&NOTEPAD.EXE&, txtPath.Text);
MessageBox.Show(&对不起,不存在该文件!&);
private void btnOpenLrcFile_Click(object sender, EventArgs e)
if (textBox1.Text.Trim() != && && textBox1.Text.Trim() != null)
if (Directory.Exists(textBox1.Text))
System.Diagnostics.Process.Start(&explorer.exe&, &/select,& + textBox1.Text);
MessageBox.Show(&对不起,不存在该文件夹,请重新指定文件夹!&);
AttibuteTuDou tudou =
#region 程序集属性访问器
public AttibuteTuDou AssemblyTitle
Assembly ass = Assembly.Load(&AttributeReflection&);
Type[] t = ass.GetTypes();
foreach (Type type in t)
Attribute[] attributes = Attribute.GetCustomAttributes(type);
if (attributes.Length & 0)
foreach (Attribute a in attributes)
tudou = (AttibuteTuDou)a;
public string AssemblyVersion
if (tudou != null)
return tudou.V
return &1.0.0&;
public string AssemblyDescription
if (tudou != null)
return tudou.OtherD
return &支持作者 支持原创&;
public string AssemblyProduct
if (tudou != null)
return tudou.P
return &土豆作品&;
public string AssemblyCopyright
if (tudou != null)
return tudou.CopyR
return &CopyRights
EUR 2010&;
public string AssemblyCompany
if (tudou != null)
return &土豆工作室&;
public string CreateDate
if (tudou != null)
return tudou.CreateD
public string LastUpDate
if (tudou != null)
return tudou.LastUpT
public string author
if (tudou != null)
return tudou.A
return &很拽の土豆&;
#endregion
private void btnDel_Click(object sender, EventArgs e)
if (this.txtPath.Text != null)
FileInfo f = new FileInfo(this.txtPath.Text);
if (f.Exists)
if (MessageBox.Show(&确认永久删除歌词& + f.FullName + &?&,&警告&,MessageBoxButtons.OKCancel,MessageBoxIcon.Warning) == DialogResult.OK)
f.Delete();
想想曾经为做这个付出的心血,不得不自己苦笑一下,兴趣吧,也许只是因为曾经的兴趣,有机会,我会再研究一下C#的。等我快老了吧。
一个非常简单的东西我却会用到高级特性,反射,系统热键注册,双缓冲,也许是因为有了需求,才有了结果吧。
先学好JAVA,做好当前事。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:2808724次
积分:30401
积分:30401
排名:第133名
原创:642篇
转载:89篇
评论:1194条
阅读:56532
(12)(18)(19)(13)(28)(29)(28)(31)(29)(2)(1)(2)(1)(2)(9)(5)(31)(30)(31)(31)(33)(26)(22)(1)(1)(3)(2)(1)(2)(1)(6)(30)(11)(3)(3)(11)(7)(11)(14)(1)(16)(43)(15)(71)(54)}

我要回帖

更多关于 卡拉ok的播放器 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信