|
After a few hours of work, I've done some prelimenary research for you.
If you use a stream from the Internet, take the following steps into consideration:
1. Connecting to the stream and requesting for a stream (HTTP commands)
2. Receiving data from the stream
3. Running the stream through a DirectShow filter chain that decodes it
4. Shoveling from the final filter in the chain into the DirectSound buffer
5. Playing back the buffer
There are at least some SHOUTCast DirectShow filters available, but I have no knowledge on how/if they work. A better way, I would feel, is to directly connect to the SHOUTCast server and request for a stream.
The entire process bases itself around the IMediaObject interface, that represents a block of media data.
First, you should create the necessary filter object, in MP3 case, it could be MPEG-1 Stream Splitter Filter, that can receive MEDIATYPE_STREAM with MEDIATYPE_MPEG1Audio.
To continue from here, you can use ACM Wrapper filter, that supports conversion from MP3 to PCM format, if you have any MP3 decoders installed (installing WinAmp will install a decoder as well).
The ACM Wrapper outputs PCM data that can be directed into a DirectSound Renderer filter, or if required, you can use IMemAllocator interface to get the decoded IMediaSample objects out from the chain.
In order to utilize the received data, you can create an instance of a IMediaSample interface (and the object), set it up to represent the data you have received (MEDIATYPE_STREAM with MEDIATYPE_MPEG1Audio subtype, for example, if you use the MPEG-1 Stream Splitter). Then get a pointer into the sample's data area, copy data from the download buffer, and call IMemInputPin::Receive on the input pin. To get the input pin, get a pointer to the IBaseFilter interface on the MPEG-1 Stream Splitter interface, and query through the pins using EnumPins. When you find the suitable IPin, query for the IMemInputPin interface on it.
This isn't a complete example on how to do it, but it should help you get started.
Alternatively, if you already have a working application that connects to a SHOUTCast source, receives data and fills a temporary buffer (raw data buffer, non-DirectSound), then I could consider joining up to write the logic to decode and playback it.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi all,
I'm really tired of looking for the solution of this annoying problem:
I have MFC application with CToolBar. In fact, I have CReBar and two CToolBars in it. I display few buttons with text in these toolbars (in single line). When user changes the size of main window and the width is not enough, I want toolbar to automatically wrap to more rows so that all buttons stay visible.
I don't want to use chevrons or floating toolbars. I create my toolbars with TBSTYLE_WRAPABLE and I tried to call SetRows(...), but it had no effect. Yes, it created as many rows as requested, but all buttons stayed in the first row even though if the size was too small to show them all.
Thank you all for any suggestion.
|
|
|
|
|
I seem to recall that toolbar button wrapping only occured at separators. Does it wrap if you add a few separators?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I tried that but no change. In fact, the toolbar gets wrapped when the size is too small, but it wraps to maximally 2 rows for me, although I call SetRows() with higher argument. Thus I think I'll have to get rid of it by writing my own code for wrapping the toolbar, since I haven't found any example on the web which uses toolbar wrapping for docked toolbar
|
|
|
|
|
Hi Im a c++ beginner, I was wondering if someone could help me with using pointers and triangular arrays. I would like to know how to define them correctly, accesing them and finally printing them with a for cycle. thanks!
links to faqs and tutorials are also greatly appreciated;)
|
|
|
|
|
Here is one solution.
char ***pArray = new char **[1];
pArray[0] = new char *[1];
pArray[0][0] = new char[32];
...
delete [] pArray[0][0];
delete pArray[0];
delete pArray;
Kuphryn
|
|
|
|
|
ok, now how would i point to a specific direction and print that? lets say^i have a an array[7][20][50]; and i would like to print it by pointers, how would i do that? or if i would like to print all rows position five etc...
thanks for your time
|
|
|
|
|
int *iArray;
iArray = new int [7][20][50];
for (int x = 0; x < 20; x++)
{
for (int y = 0; y < 50; y++)
{
}
} Hope that's helpful.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
If I wanted to find all the child windows on a dialog that were edit controls should I be able to use the following code
FindWindow ("EDIT", NULL); If so should this code work in the first WM_PAINT message that a dialog receives? I ask because I try it and when it executes it returns NULL. I do have edit controls on my dialog. Any help is appreciated. Thanks.
- Aaron
|
|
|
|
|
|
Thanks for the information. One question...how do I inspect the window class to see if it's an edit control? How do I get the window class information from the hwnd value? Thanks again.
- Aaron
|
|
|
|
|
Try:
TCHAR buff[ 32 ];
GetClassName( hWnd, buff, sizeof( buff )-1 );
if ( stricmp( buff, "edit" ) == 0 )
;
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Works beautifully. Thanks Neville.
- Aaron
|
|
|
|
|
Neville Franks wrote:
www.surfulater.com
Looks nicer by the day, Neville!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
I have the followings:
1. A Dll with a custom control (ControlDll.dll)
2. A dll with a dialog using the custom control (DialogDll.dll)
3. An exe that uses the dialog from DialogDll.dll
The control is register nicely like all custom controls using AfxRegisterClass...
When i run the exe, it failed (the dialog was not displayed), what i did is the following:
Checked teh 'no fail create' to see where it failed, and found out it could not find the control from the ID while in 'PrepareCtrl' of the DDX_Control of my custom control.
I then created another dialog, this time in the exe, which uses the same custom control from the ControlDll.dll, and it worked!
It seems that the nesting of dll within dll, and the custom control registration some how got lost
Any help will be wolcomed
10x
ronhash
|
|
|
|
|
I use Timer in my service prog like that:
timer2ID=SetTimer(NULL, 0, INTERVAl,Timer2);
when compile Debug ,it is perfect.but when complie Release,show the error :
D:\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxwin2.inl(469) : error C2039: 'OnTimer' : is not a member of 'CWnd'
D:\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxwin2.inl(470) : error C2065: 'Default' : undeclared identifier
I don't use CWnd class in my prog.what is the problem?
appreciate any help!!!
|
|
|
|
|
timer2ID=::SetTimer(NULL, 0, INTERVAl,Timer2);
if you use windows api functions but i am not shure what classes and functions you have because you include mfc library.
|
|
|
|
|
Hi All!
Can Any one tell me how to luanch an application by double clicking a file which is associated with the application's icon
Thank Y'All !
|
|
|
|
|
One possible solution is RegisterShellFileTypes().
Kuphryn
|
|
|
|
|
I can't get to my Visual Studio right now, but i had the same problem. there's a function of CWinApp called enableShellOpen or something like that. put that function in your app's initinstance function and it should work.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hi,
I have a 3 way split window, horizontal and vertical.
1st on the left is a FormView, containing a lot of edit and radio buttons, suppose to display the different cordinates.
2nd, first row on the right, which is the main view class has a ScrollView.
3rd, second row on the right, has a FormView.
I need to capture the mouse click and movement on the 2nd window and display the coordinates in the edit boxes in 1st window.
Can anyone help
lvidot
|
|
|
|
|
One solution is to add a message handler for the mouse move message in the view class.
Kuphryn
|
|
|
|
|
Thanks,
I'm new to this environment....
So how do I go about that?....
Any help will be most appreciated...
|
|
|
|
|
What are the steps to save the content of the CDC to the Bitmap file?
Well going through the MSDn and web articles i found some of the handy tools that are used for saving the content of Memory device context to bitmap file are:
1.0 Fill the BITMAPHEADERINFO structure
2.0 uSE THE GetDIBits() function
3.0 Use of CreateDIBSection to write
Problem Statement: I am having a global Memory device context. In a function i am initialising it as Mem. DC by calling API -> CreateCompatibleDC().
All the drawing stuff is drawn to it.
Now on Save i have to save the content of the MemoryDevice Context ( MemDC) to a Bitmap file.
Any solution,idea and guidelines to do this.
Leave your mark wherever you go
|
|
|
|
|
codeproject
MFC / C++ >> Bitmaps & Palettes
CxImage
CDibData
A DIBSection wrapper for Win32 and WinCE
etc...
INTP
|
|
|
|