国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C++ > 正文

C++實現顯示MP3文件信息的方法

2020-01-26 15:05:39
字體:
來源:轉載
供稿:網友

本文實例講述了C++實現顯示MP3文件信息的方法。分享給大家供大家參考。具體實現方法如下:

/** * This is small example how to use libZPlay library to play files. * This example is using OpenFile functions to open disk files and play. */#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <olectl.h>#include <ole2.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <conio.h>#include <dos.h>#include <conio.h>#include "../include/libzplay.h"using namespace libZPlay;ZPlay* player;int __stdcall CallbackFunc(void* instance, void *user_data, TCallbackMessage message, unsigned int param1, unsigned int param2);int main(int argc, char **argv){  // clear screen  system("CLS");  // create class instance  player = CreateZPlay();  // chek if we have class instance  if(player == 0)  {    printf("Error: Can't create class instance !nPress key to exit.n");    getch();    return 0;    }  // get library version  int ver = player->GetVersion();  // check if we have version 2.00 and above  if(ver < 200)  {    printf("Error: Need library version 2.00 and above !nPress key to exit./r/n");    getch();    player->Release();    return 0;  }  // display version info  printf("libZPlay v.%i.%02i/r/n/r/n", ver / 100, ver % 100);  if(argc > 1)   {    TID3InfoEx id3_info;    if(player->LoadFileID3Ex(argv[1], sfAutodetect, &id3_info, 1)) // loading ID3v2    {      printf("Title:  %s/r/n", id3_info.Title);      printf("Artist: %s/r/n", id3_info.Artist);      printf("Album:  %s/r/n", id3_info.Album);      printf("Year:  %s/r/n", id3_info.Year);      printf("Comment: %s/r/n", id3_info.Comment);      printf("Genre:  %s/r/n", id3_info.Genre);      printf("Track:  %s/r/n/r/n", id3_info.TrackNum);      printf("Artist1 : %s/r/n", id3_info.AlbumArtist );      printf("Composer: %s/r/n", id3_info.Composer );      printf("Original: %s/r/n", id3_info.OriginalArtist );      printf("Copyright: %s/r/n", id3_info.Copyright );      printf("URL:    %s/r/n", id3_info.URL );      printf("Encoder:  %s/r/n", id3_info.Encoder );      printf("Publisher: %s/r/n", id3_info.Publisher );      printf("BPM:    %u/r/n", id3_info.BPM);      printf("MIME:   %s/r/n", id3_info.Picture.MIMEType);      printf("TYPE:   %u/r/n", id3_info.Picture.PictureType);      printf("Desc:   %s/r/n", id3_info.Picture.Description);      printf("Size:   %u/r/n", id3_info.Picture.PictureDataSize);      // draw picture on desktop window      player->DrawBitmapToHWND(NULL, 0, 0, 0, 0, id3_info.Picture.hBitmap);    }    else    {      printf("No ID3 data/r/n/r/n");    }   }   else   {   // no filename in argument    player->Release(); // delete ZPlay class    char *end = strrchr(argv[0], '/');    if(end && *(end + 1) != 0)      end++;    else      end = argv[0];    printf("Usage: %s filename/r/n/r/nPress key to exit/r/n", end);    getch();    return 0;   }  getch();}

希望本文所述對大家的C++程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武鸣县| 东源县| 赤峰市| 万盛区| 松原市| 蕉岭县| 泰来县| 慈溪市| 黄冈市| 揭西县| 广东省| 淮阳县| 梓潼县| 凤山县| 固镇县| 中方县| 四川省| 通榆县| 湛江市| 林口县| 彝良县| 化州市| 阳信县| 通化县| 平舆县| 万盛区| 韶关市| 茶陵县| 南溪县| 吉木萨尔县| 嵊泗县| 滨州市| 五大连池市| 普定县| 酒泉市| 云梦县| 云梦县| 无棣县| 金坛市| 江油市| 诸城市|