ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
28 participants
483 discussions
Start a n
N
ew thread
[janderwald] 39954: - Use Interlocked*List function to improve stability as a few of the timing issues have been resolved - Queue a dpc for each completed buffer - Complete the irp as soon as possible
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 11 21:00:11 2009 New Revision: 39954 URL:
http://svn.reactos.org/svn/reactos?rev=39954&view=rev
Log: - Use Interlocked*List function to improve stability as a few of the timing issues have been resolved - Queue a dpc for each completed buffer - Complete the irp as soon as possible Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h [iso-8859-1] Wed Mar 11 21:00:11 2009 @@ -216,6 +216,10 @@ STDMETHOD_(BOOL, CancelBuffers)(THIS); + STDMETHOD_(VOID, UpdateFormat)(THIS_ + IN PKSDATAFORMAT DataFormat); + + }; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] Wed Mar 11 21:00:11 2009 @@ -13,9 +13,11 @@ typedef struct _IRP_MAPPING_ { + LIST_ENTRY Entry; KSSTREAM_HEADER *Header; PIRP Irp; - struct _IRP_MAPPING_ * Next; + KDPC Dpc; + }IRP_MAPPING, *PIRP_MAPPING; typedef struct @@ -30,15 +32,11 @@ KSPIN_CONNECT *ConnectDetails; PKSDATAFORMAT_WAVEFORMATEX DataFormat; - KDPC Dpc; PIRP_MAPPING FirstMap; PIRP_MAPPING LastMap; - ULONG DpcActive; - PIRP_MAPPING FreeMapHead; - PIRP_MAPPING FreeMapTail; - ULONG FreeDataSize; - LONG FreeCount; + KSPIN_LOCK Lock; + LIST_ENTRY ListHead; }IIrpQueueImpl; @@ -50,39 +48,22 @@ IN PVOID SystemArgument1, IN PVOID SystemArgument2) { - PIRP_MAPPING CurMapping, NextMapping = NULL; - ULONG Count; - IIrpQueueImpl * This = (IIrpQueueImpl*)DeferredContext; + PIRP_MAPPING CurMapping; CurMapping = (PIRP_MAPPING)SystemArgument1; ASSERT(CurMapping); - Count = 0; - while(CurMapping) - { - NextMapping = CurMapping->Next; - - This->FreeDataSize -= CurMapping->Header->DataUsed; - - if (CurMapping->Irp) - { - CurMapping->Irp->IoStatus.Information = CurMapping->Header->FrameExtent; - CurMapping->Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(CurMapping->Irp, IO_SOUND_INCREMENT); - } - - ExFreePool(CurMapping->Header->Data); - ExFreePool(CurMapping->Header); - - ExFreePool(CurMapping); - - CurMapping = NextMapping; - InterlockedDecrement(&This->FreeCount); - - Count++; - } - This->DpcActive = FALSE; - DPRINT1("Freed %u Buffers / IRP Available Mappings %u\n", Count, This->NumMappings); + if (CurMapping->Irp) + { + CurMapping->Irp->IoStatus.Information = CurMapping->Header->FrameExtent; + CurMapping->Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(CurMapping->Irp, IO_SOUND_INCREMENT); + } + + ExFreePool(CurMapping->Header->Data); + ExFreePool(CurMapping->Header); + + ExFreePool(CurMapping); } NTSTATUS @@ -144,8 +125,8 @@ This->ConnectDetails = ConnectDetails; This->DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)DataFormat; - - KeInitializeDpc(&This->Dpc, DpcRoutine, (PVOID)This); + InitializeListHead(&This->ListHead); + KeInitializeSpinLock(&This->Lock); return STATUS_SUCCESS; } @@ -167,18 +148,17 @@ Mapping->Header = (KSSTREAM_HEADER*)Buffer; Mapping->Irp = Irp; - Mapping->Next = NULL; - - //DPRINT1("FirstMap %p LastMap %p NumMappings %u\n", This->FirstMap, This->LastMap, This->NumMappings); - - if (!This->FirstMap) - This->FirstMap = Mapping; - else - This->LastMap->Next = Mapping; - - This->LastMap = Mapping; - - InterlockedIncrement(&This->NumMappings); + KeInitializeDpc(&Mapping->Dpc, DpcRoutine, (PVOID)Mapping); + + This->NumDataAvailable += Mapping->Header->DataUsed; + + DPRINT1("IIrpQueue_fnAddMapping NumMappings %u SizeOfMapping %lu NumDataAvailable %lu Irp %p\n", This->NumMappings, Mapping->Header->DataUsed, This->NumDataAvailable, Irp); + + /* FIXME use InterlockedCompareExchangePointer */ + if (InterlockedCompareExchange((volatile long *)&This->FirstMap, (LONG)Mapping, (LONG)0) != 0) + ExInterlockedInsertTailList(&This->ListHead, &Mapping->Entry, &This->Lock); + + (void)InterlockedIncrement((volatile long*)&This->NumMappings); if (Irp) { @@ -187,9 +167,6 @@ IoMarkIrpPending(Irp); } - This->NumDataAvailable += Mapping->Header->DataUsed; - - DPRINT1("IIrpQueue_fnAddMapping NumMappings %u SizeOfMapping %lu NumDataAvailable %lu Irp %p\n", This->NumMappings, Mapping->Header->DataUsed, This->NumDataAvailable, Irp); return STATUS_SUCCESS; } @@ -227,35 +204,16 @@ if (This->FirstMap->Header->DataUsed <=This->CurrentOffset) { This->CurrentOffset = 0; - Mapping = This->FirstMap; - This->FirstMap = This->FirstMap->Next; - - if (!This->FirstMap) - This->LastMap = NULL; - - This->FreeCount++; - - if (!This->FreeMapHead) - This->FreeMapHead = Mapping; - else - This->FreeMapTail->Next = Mapping; - - This->FreeMapTail = Mapping; - Mapping->Next = NULL; - This->FreeDataSize += Mapping->Header->DataUsed; + Mapping = (PIRP_MAPPING)ExInterlockedRemoveHeadList(&This->ListHead, &This->Lock); + InterlockedDecrement(&This->NumMappings); - This->NumDataAvailable -= Mapping->Header->DataUsed; - - - if (This->FreeCount > 5 && This->DpcActive == FALSE) - { - Mapping = This->FreeMapHead; - This->FreeMapHead = NULL; - This->FreeMapTail = NULL; - This->DpcActive = TRUE; - KeInsertQueueDpc(&This->Dpc, (PVOID)Mapping, NULL); - } - } + This->NumDataAvailable -= This->FirstMap->Header->DataUsed; + + KeInsertQueueDpc(&This->FirstMap->Dpc, (PVOID)This->FirstMap, NULL); + (void)InterlockedExchangePointer((PVOID volatile*)&This->FirstMap, (PVOID)Mapping); + + } + } ULONG @@ -298,29 +256,20 @@ IIrpQueue_fnCancelBuffers( IN IIrpQueue *iface) { - PIRP_MAPPING Mapping; - IIrpQueueImpl * This = (IIrpQueueImpl*)iface; - - if (This->DpcActive) - return FALSE; - - ASSERT(This->FirstMap == NULL); - ASSERT(This->LastMap == NULL); - - if (This->FreeMapHead == NULL) - { - ASSERT(This->FreeMapTail == NULL); - This->FreeMapTail = NULL; - return TRUE; - } - - Mapping = This->FreeMapHead; - This->FreeMapHead = NULL; - This->FreeMapTail = NULL; - This->DpcActive = TRUE; - KeInsertQueueDpc(&This->Dpc, (PVOID)Mapping, NULL); - return FALSE; -} + return TRUE; +} + +VOID +NTAPI +IIrpQueue_fnUpdateFormat( + IN IIrpQueue *iface, + PKSDATAFORMAT DataFormat) +{ + IIrpQueueImpl * This = (IIrpQueueImpl*)iface; + This->DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)DataFormat; + +} + static IIrpQueueVtbl vt_IIrpQueue = { @@ -334,7 +283,8 @@ IIrpQueue_fnNumMappings, IIrpQueue_fnMinMappings, IIrpQueue_fnMinimumDataAvailable, - IIrpQueue_fnCancelBuffers + IIrpQueue_fnCancelBuffers, + IIrpQueue_fnUpdateFormat }; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] Wed Mar 11 21:00:11 2009 @@ -334,8 +334,9 @@ if (Property->Flags & KSPROPERTY_TYPE_SET) { + Status = STATUS_UNSUCCESSFUL; Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; + if (This->Stream) { Status = This->Stream->lpVtbl->SetState(This->Stream, *State); @@ -344,14 +345,11 @@ if (NT_SUCCESS(Status)) { This->State = *State; - Irp->IoStatus.Information = sizeof(KSSTATE); - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; } - Irp->IoStatus.Status = Status; } - return Irp->IoStatus.Status; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; } else if (Property->Flags & KSPROPERTY_TYPE_GET) { @@ -379,24 +377,29 @@ if (This->Stream) { - while(!This->IrpQueue->lpVtbl->CancelBuffers(This->IrpQueue)) - KeStallExecutionProcessor(10); - - This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP); + Status = This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP); This->State = KSSTATE_STOP; + DPRINT1("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)DataFormat)->WaveFormatEx.nChannels, + ((PKSDATAFORMAT_WAVEFORMATEX)DataFormat)->WaveFormatEx.wBitsPerSample, + ((PKSDATAFORMAT_WAVEFORMATEX)DataFormat)->WaveFormatEx.nSamplesPerSec); Status = This->Stream->lpVtbl->SetFormat(This->Stream, NewDataFormat); if (NT_SUCCESS(Status)) { if (This->Format) ExFreePoolWithTag(This->Format, TAG_PORTCLASS); + + This->IrpQueue->lpVtbl->UpdateFormat(This->IrpQueue, (PKSDATAFORMAT)NewDataFormat); This->Format = NewDataFormat; Irp->IoStatus.Information = DataFormat->FormatSize; Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } + } + DPRINT1("Failed to set format\n"); +DbgBreakPoint(); Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -658,37 +661,33 @@ Packet = (PCONTEXT_WRITE)Buffer; + if (This->IrpQueue->lpVtbl->MinimumDataAvailable(This->IrpQueue)) + { Irp = Packet->Irp; + StatusBlock->Status = STATUS_PENDING; + } else + { Irp = NULL; - - Status = This->IrpQueue->lpVtbl->AddMapping(This->IrpQueue, Buffer, Length, Irp); - - if (!NT_SUCCESS(Status)) - return FALSE; - - if (This->IrpQueue->lpVtbl->MinimumDataAvailable(This->IrpQueue) == TRUE && This->State != KSSTATE_RUN) - { - /* some should initiate a state request but didnt do it */ - DPRINT1("Starting stream with %lu mappings\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue)); - - This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_RUN); - This->State = KSSTATE_RUN; - } - - if (!Irp) - { - //DPRINT1("Completing Irp %p\n", Packet->Irp); - Packet->Irp->IoStatus.Status = STATUS_SUCCESS; Packet->Irp->IoStatus.Information = Packet->Header.FrameExtent; IoCompleteRequest(Packet->Irp, IO_SOUND_INCREMENT); StatusBlock->Status = STATUS_SUCCESS; } - else - { - StatusBlock->Status = STATUS_PENDING; + + Status = This->IrpQueue->lpVtbl->AddMapping(This->IrpQueue, Buffer, Length, Irp); + + if (!NT_SUCCESS(Status)) + return FALSE; + + if (This->IrpQueue->lpVtbl->MinimumDataAvailable(This->IrpQueue) == TRUE && This->State != KSSTATE_RUN) + { + /* some should initiate a state request but didnt do it */ + DPRINT1("Starting stream with %lu mappings\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue)); + + This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_RUN); + This->State = KSSTATE_RUN; } return TRUE;
15 years, 9 months
1
0
0
0
[dchapyshev] 39953: - Add Ukrainian translation by Sakara Yevhen - Other small changes
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Mar 11 20:40:01 2009 New Revision: 39953 URL:
http://svn.reactos.org/svn/reactos?rev=39953&view=rev
Log: - Add Ukrainian translation by Sakara Yevhen - Other small changes Added: trunk/reactos/base/applications/mplay32/lang/uk-UA.rc (with props) Modified: trunk/reactos/base/applications/mplay32/mplay32.c trunk/reactos/base/applications/mplay32/rsrc.rc Added: trunk/reactos/base/applications/mplay32/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/lang/uk-UA.rc (added) +++ trunk/reactos/base/applications/mplay32/lang/uk-UA.rc [iso-8859-1] Wed Mar 11 20:40:01 2009 @@ -1,0 +1,29 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +IDR_MAINMENU MENU +BEGIN + POPUP "&Ôàéë" + BEGIN + MENUITEM "&³äêðèòè...", IDM_OPEN_FILE + MENUITEM "&Çàêðèòè", IDM_CLOSE_FILE + MENUITEM SEPARATOR + MENUITEM "&Âèõ³ä", IDM_EXIT + END + POPUP "&Äîâ³äêà" + BEGIN + MENUITEM "&Ïðî ïðîãðàìó...", IDM_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALL_TYPES_FILTER "Âñ³ ï³äòðèìóâàí³ (*.wav, *.cda, *.midi, *.mid, *.avi)\0*.wav;*.cda;*.midi;*.mid;*.avi\0" + IDS_TOOLTIP_PLAY "³äòâîðåííÿ" + IDS_TOOLTIP_STOP "Çóïèíèòè" + IDS_TOOLTIP_EJECT "Âèòÿãòè" + IDS_TOOLTIP_BACKWARD "Íàçàä" + IDS_TOOLTIP_SEEKBACK "Ïåðåìîòóâàííÿ íàçàä" + IDS_TOOLTIP_SEEKFORW "Ïåðåìîòóâàííÿ âïåðåä" + IDS_TOOLTIP_FORWARD "Âïåðåä" + IDS_APPTITLE "Ïðîãðàâà÷ ReactOS" +END Propchange: trunk/reactos/base/applications/mplay32/lang/uk-UA.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/mplay32/mplay32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Wed Mar 11 20:40:01 2009 @@ -106,7 +106,7 @@ 0, 0, 340, - 30, + 20, hwnd, NULL, hInstance, @@ -142,7 +142,7 @@ } static UINT -IsSupportedFileExtension(LPWSTR lpFileName) +IsSupportedFileExtension(LPTSTR lpFileName) { TCHAR szExt[MAX_PATH]; INT DotPos = 0, i, j; @@ -197,10 +197,11 @@ } static DWORD -OpenMciDevice(LPTSTR lpType, LPTSTR lpFileName) +OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) { MCI_STATUS_PARMS mciStatus; MCI_OPEN_PARMS mciOpen; + TCHAR szNewTitle[MAX_PATH]; DWORD dwError; if (bIsOpened) @@ -252,10 +253,13 @@ SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100000, (LPARAM) 0); } + _stprintf(szNewTitle, _T("%s - %s"), szAppTitle, lpFileName); + SetWindowText(hwnd, szNewTitle); + MaxFilePos = mciStatus.dwReturn; wDeviceId = mciOpen.wDeviceID; bIsOpened = TRUE; - lstrcpy(szPrevFile, lpFileName); + _tcscpy(szPrevFile, lpFileName); return TRUE; } @@ -398,7 +402,7 @@ } static VOID -PlayFile(HWND hwnd, LPWSTR lpFileName) +PlayFile(HWND hwnd, LPTSTR lpFileName) { MCI_PLAY_PARMS mciPlay; TCHAR szLocalFileName[MAX_PATH]; @@ -410,11 +414,11 @@ if (szPrevFile[0] == _T('\0')) return; - lstrcpy(szLocalFileName, szPrevFile); + _tcscpy(szLocalFileName, szPrevFile); } else { - lstrcpy(szLocalFileName, lpFileName); + _tcscpy(szLocalFileName, lpFileName); } if (GetFileAttributes(szLocalFileName) == INVALID_FILE_ATTRIBUTES) @@ -430,16 +434,16 @@ MessageBox(hwnd, _T("Unsupported format!"), NULL, MB_OK); return; case WAVE_FILE: - OpenMciDevice(_T("waveaudio"), szLocalFileName); + OpenMciDevice(hwnd, _T("waveaudio"), szLocalFileName); break; case MIDI_FILE: - OpenMciDevice(_T("sequencer"), szLocalFileName); + OpenMciDevice(hwnd, _T("sequencer"), szLocalFileName); break; case AUDIOCD_FILE: - OpenMciDevice(_T("cdaudio"), szLocalFileName); + OpenMciDevice(hwnd, _T("cdaudio"), szLocalFileName); break; case AVI_FILE: - OpenMciDevice(_T("avivideo"), szLocalFileName); + OpenMciDevice(hwnd, _T("avivideo"), szLocalFileName); break; } @@ -471,7 +475,7 @@ if (!GetCurrentDirectory(sizeof(szCurrentDir) / sizeof(TCHAR), szCurrentDir)) { - lstrcpy(szCurrentDir, _T("c:\\")); + _tcscpy(szCurrentDir, _T("c:\\")); } OpenFileName.lStructSize = sizeof(OpenFileName); @@ -633,7 +637,7 @@ case IDM_CLOSE_FILE: StopPlayback(hwnd); - lstrcpy(szPrevFile, _T("\0")); + _tcscpy(szPrevFile, _T("\0")); break; case IDM_ABOUT: Modified: trunk/reactos/base/applications/mplay32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] Wed Mar 11 20:40:01 2009 @@ -6,3 +6,4 @@ #include "lang/es-ES.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" +#include "lang/uk-UA.rc"
15 years, 9 months
1
0
0
0
[janderwald] 39952: - Implement wave pcm bitrate conversion. Atm only 8-16 bit has been tested - The tricky part is just to get result value into the right byte order (endianess) - Thanks to Christoph and everyone else :)
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 11 17:42:42 2009 New Revision: 39952 URL:
http://svn.reactos.org/svn/reactos?rev=39952&view=rev
Log: - Implement wave pcm bitrate conversion. Atm only 8-16 bit has been tested - The tricky part is just to get result value into the right byte order (endianess) - Thanks to Christoph and everyone else :) Modified: trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c Modified: trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/filters/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c [iso-8859-1] Wed Mar 11 17:42:42 2009 @@ -10,6 +10,27 @@ const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; +#ifdef _X86_ +#define htons(w) \ + ((((w) & 0xFF00) >> 8) | \ + (((w) & 0x00FF) << 8)) + +#define htonl(n) (((((unsigned long)(n) & 0xFF)) << 24) | \ + ((((unsigned long)(n) & 0xFF00)) << 8) | \ + ((((unsigned long)(n) & 0xFF0000)) >> 8) | \ + ((((unsigned long)(n) & 0xFF000000)) >> 24)) + +#define ntohs(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8)) + + +#define ntohl(n) (((((unsigned long)(n) & 0xFF)) << 24) | \ + ((((unsigned long)(n) & 0xFF00)) << 8) | \ + ((((unsigned long)(n) & 0xFF0000)) >> 8) | \ + ((((unsigned long)(n) & 0xFF000000)) >> 24)) + +#endif + + NTSTATUS PerformQualityConversion( PUCHAR Buffer, @@ -24,12 +45,8 @@ ASSERT(OldWidth != NewWidth); - /* FIXME - * This code does not work at all - */ - Samples = BufferLength / (OldWidth / 8); - DPRINT1("Samples %u BufferLength %u\n", Samples, BufferLength); + //DPRINT("Samples %u BufferLength %u\n", Samples, BufferLength); if (OldWidth == 8 && NewWidth == 16) { @@ -41,34 +58,41 @@ for(Index = 0; Index < Samples; Index++) { Sample = Buffer[Index]; - BufferOut[Index] = Sample * 256; + Sample *= 2; + BufferOut[Index] = htons(Sample); } *Result = BufferOut; *ResultLength = Samples * sizeof(USHORT); - DPRINT1("done\n"); } else if (OldWidth == 8 && NewWidth == 32) { + ULONG Sample; PULONG BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(ULONG)); if (!BufferOut) return STATUS_INSUFFICIENT_RESOURCES; for(Index = 0; Index < Samples; Index++) { - BufferOut[Index] = Buffer[Index] * 16777216; + Sample = Buffer[Index]; + Sample *= 16777216; + BufferOut[Index] = htonl(Sample); } *Result = BufferOut; *ResultLength = Samples * sizeof(ULONG); } else if (OldWidth == 16 && NewWidth == 32) { + ULONG Sample; + PUSHORT BufferIn = (PUSHORT)Buffer; PULONG BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(ULONG)); if (!BufferOut) return STATUS_INSUFFICIENT_RESOURCES; for(Index = 0; Index < Samples; Index++) { - BufferOut[Index] = Buffer[Index] * 65536; + Sample = BufferIn[Index]; + Sample *= 65536; + BufferOut[Index] = htonl(Sample); } *Result = BufferOut; *ResultLength = Samples * sizeof(ULONG); @@ -76,39 +100,54 @@ else if (OldWidth == 16 && NewWidth == 8) { + USHORT Sample; + PUSHORT BufferIn = (PUSHORT)Buffer; PUCHAR BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(UCHAR)); if (!BufferOut) return STATUS_INSUFFICIENT_RESOURCES; for(Index = 0; Index < Samples; Index++) { - BufferOut[Index] = (Buffer[Index] / 256) & 0xFF; + Sample = BufferIn[Index]; + Sample = ntohs(Sample); + Sample /= 256; + BufferOut[Index] = (Sample / 0xFF); } *Result = BufferOut; *ResultLength = Samples * sizeof(UCHAR); } else if (OldWidth == 32 && NewWidth == 8) { + ULONG Sample; + PULONG BufferIn = (PULONG)Buffer; PUCHAR BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(UCHAR)); if (!BufferOut) return STATUS_INSUFFICIENT_RESOURCES; for(Index = 0; Index < Samples; Index++) { - BufferOut[Index] = (Buffer[Index] / 16777216) & 0xFF; + Sample = BufferIn[Index]; + Sample = ntohl(Sample); + Sample /= 16777216; + BufferOut[Index] = Sample & 0xFF; } *Result = BufferOut; *ResultLength = Samples * sizeof(UCHAR); } else if (OldWidth == 32 && NewWidth == 16) { + USHORT Sample; + PULONG BufferIn = (PULONG)Buffer; PUSHORT BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(USHORT)); if (!BufferOut) return STATUS_INSUFFICIENT_RESOURCES; for(Index = 0; Index < Samples; Index++) { - BufferOut[Index] = (Buffer[Index] / 65536) & 0xFFFF; + Sample = BufferIn[Index]; + Sample = ntohl(Sample); + Sample /= 65536; + BufferOut[Index] = Sample & 0xFFFF; } *Result = BufferOut; *ResultLength = Samples * sizeof(USHORT);
15 years, 9 months
1
0
0
0
[dreimer] 39950: Translate the ReactOS MediaPlayer into German and Polish (Maciej Bialas). Sync WinHLP32 and WordPad with Wine HEAD.
by dreimer@svn.reactos.org
Author: dreimer Date: Wed Mar 11 15:11:28 2009 New Revision: 39950 URL:
http://svn.reactos.org/svn/reactos?rev=39950&view=rev
Log: Translate the ReactOS MediaPlayer into German and Polish (Maciej Bialas). Sync WinHLP32 and WordPad with Wine HEAD. Added: trunk/reactos/base/applications/mplay32/lang/de-DE.rc (with props) trunk/reactos/base/applications/mplay32/lang/pl-PL.rc (with props) Modified: trunk/reactos/base/applications/mplay32/rsrc.rc trunk/reactos/base/applications/winhlp32/winhelp.c trunk/reactos/base/applications/wordpad/Da.rc trunk/reactos/base/applications/wordpad/De.rc trunk/reactos/base/applications/wordpad/En.rc trunk/reactos/base/applications/wordpad/Fr.rc trunk/reactos/base/applications/wordpad/Hu.rc trunk/reactos/base/applications/wordpad/Ja.rc trunk/reactos/base/applications/wordpad/Ko.rc trunk/reactos/base/applications/wordpad/Nl.rc trunk/reactos/base/applications/wordpad/No.rc trunk/reactos/base/applications/wordpad/Pl.rc trunk/reactos/base/applications/wordpad/Pt.rc trunk/reactos/base/applications/wordpad/Ru.rc trunk/reactos/base/applications/wordpad/Si.rc trunk/reactos/base/applications/wordpad/Sv.rc trunk/reactos/base/applications/wordpad/Tr.rc trunk/reactos/base/applications/wordpad/Zh.rc trunk/reactos/base/applications/wordpad/wordpad.c trunk/reactos/base/applications/wordpad/wordpad.h Added: trunk/reactos/base/applications/mplay32/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/lang/de-DE.rc (added) +++ trunk/reactos/base/applications/mplay32/lang/de-DE.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -1,0 +1,29 @@ +LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL + +IDR_MAINMENU MENU +BEGIN + POPUP "&Datei" + BEGIN + MENUITEM "Ö&ffnen...", IDM_OPEN_FILE + MENUITEM "Sch&ließen", IDM_CLOSE_FILE + MENUITEM SEPARATOR + MENUITEM "&Beenden", IDM_EXIT + END + POPUP "&Hilfe" + BEGIN + MENUITEM "&Über...", IDM_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALL_TYPES_FILTER "Alle Unterstützten (*.wav, *.cda, *.midi, *.mid, *.avi)\0*.wav;*.cda;*.midi;*.mid;*.avi\0" + IDS_TOOLTIP_PLAY "wiedergabe" + IDS_TOOLTIP_STOP "Stopp" + IDS_TOOLTIP_EJECT "Auswerfen" + IDS_TOOLTIP_BACKWARD "Zurück" + IDS_TOOLTIP_SEEKBACK "Schneller Rücklauf" + IDS_TOOLTIP_SEEKFORW "Schneller Vorlauf" + IDS_TOOLTIP_FORWARD "Weiter" + IDS_APPTITLE "ReactOS Multimedia Player" +END Propchange: trunk/reactos/base/applications/mplay32/lang/de-DE.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mplay32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/lang/pl-PL.rc (added) +++ trunk/reactos/base/applications/mplay32/lang/pl-PL.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -1,0 +1,31 @@ +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT + +//By Maciej Bialas + +IDR_MAINMENU MENU +BEGIN + POPUP "&Plik" + BEGIN + MENUITEM "&Otwórz...", IDM_OPEN_FILE + MENUITEM "&Zamknij", IDM_CLOSE_FILE + MENUITEM SEPARATOR + MENUITEM "&Wyjd", IDM_EXIT + END + POPUP "&Pomoc" + BEGIN + MENUITEM "&O programie...", IDM_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALL_TYPES_FILTER "Wszystkie formaty (*.wav, *.cda, *.midi, *.mid, *.avi)\0*.wav;*.cda;*.midi;*.mid;*.avi\0" + IDS_TOOLTIP_PLAY "Odtwarzaj" + IDS_TOOLTIP_STOP "Zatrzymaj" + IDS_TOOLTIP_EJECT "Wysuñ" + IDS_TOOLTIP_BACKWARD "Przeskocz do ty³u" + IDS_TOOLTIP_SEEKBACK "Przewiñ do ty³u" + IDS_TOOLTIP_SEEKFORW "Przewiñ do przodu" + IDS_TOOLTIP_FORWARD "Przeskocz do przodu" + IDS_APPTITLE "ReactOS Multimedia Player" +END Propchange: trunk/reactos/base/applications/mplay32/lang/pl-PL.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/mplay32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -1,5 +1,7 @@ #include <windows.h> #include "resource.h" +#include "lang/de-DE.rc" #include "lang/en-US.rc" +#include "lang/pl-PL.rc" #include "lang/ru-RU.rc" Modified: trunk/reactos/base/applications/winhlp32/winhelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -274,9 +274,7 @@ { strcpy(mwi.type, "primary"); strcpy(mwi.name, "main"); - if (hlpfile && !LoadString(Globals.hInstance, STID_WINE_HELP, - mwi.caption, sizeof(mwi.caption))) - strcpy(mwi.caption, hlpfile->lpszTitle); + LoadString(Globals.hInstance, STID_WINE_HELP, mwi.caption, sizeof(mwi.caption)); mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT; mwi.style = SW_SHOW; mwi.win_style = WS_OVERLAPPEDWINDOW; @@ -1265,8 +1263,7 @@ { WINHELP_WINDOW *win; WINHELP_BUTTON *button; - RECT rect; - INT curPos, min, max, dy, keyDelta; + INT keyDelta; HWND hTextWnd; LRESULT ret; @@ -1381,42 +1378,23 @@ case WM_KEYDOWN: keyDelta = 0; + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT); switch (wParam) { case VK_UP: + SendMessage(hTextWnd, EM_SCROLL, SB_LINEUP, 0); + return 0; case VK_DOWN: - keyDelta = GetSystemMetrics(SM_CXVSCROLL); - if (wParam == VK_UP) - keyDelta = -keyDelta; - + SendMessage(hTextWnd, EM_SCROLL, SB_LINEDOWN, 0); + return 0; case VK_PRIOR: + SendMessage(hTextWnd, EM_SCROLL, SB_PAGEUP, 0); + return 0; case VK_NEXT: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT); - curPos = GetScrollPos(hTextWnd, SB_VERT); - GetScrollRange(hTextWnd, SB_VERT, &min, &max); - - if (keyDelta == 0) - { - GetClientRect(hTextWnd, &rect); - keyDelta = (rect.bottom - rect.top) / 2; - if (wParam == VK_PRIOR) - keyDelta = -keyDelta; - } - - curPos += keyDelta; - if (curPos > max) - curPos = max; - else if (curPos < min) - curPos = min; - - dy = GetScrollPos(hTextWnd, SB_VERT) - curPos; - SetScrollPos(hTextWnd, SB_VERT, curPos, TRUE); - ScrollWindow(hTextWnd, 0, dy, NULL, NULL); - UpdateWindow(hTextWnd); + SendMessage(hTextWnd, EM_SCROLL, SB_PAGEDOWN, 0); return 0; - case VK_ESCAPE: MACRO_Exit(); return 0; Modified: trunk/reactos/base/applications/wordpad/Da.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Da.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Da.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -150,7 +150,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tabulatorstop", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Tilføj", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Fjern", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/De.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/De.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -152,7 +152,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tabstoppposition", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Festlegen", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Löschen", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/En.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/En.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -150,7 +150,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tab stops", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Add", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Remove", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 @@ -239,5 +239,6 @@ STRING_WRITE_ACCESS_DENIED, "You do not have access to save the file." STRING_OPEN_FAILED, "Could not open the file." STRING_OPEN_ACCESS_DENIED, "You do not have access to open the file." - STRING_PRINTING_NOT_IMPLEMENTED, "Printing not implemented" -END + STRING_PRINTING_NOT_IMPLEMENTED, "Printing not implemented" + STRING_MAX_TAB_STOPS, "Cannot add more than 32 tab stops." +END Modified: trunk/reactos/base/applications/wordpad/Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Fr.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Fr.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -150,7 +150,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Arrêts de tabulation", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Ajouter", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Supprimer", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Hu.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Hu.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Hu.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -150,7 +150,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tab stops", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Add", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Remove", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Ja.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Ja.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Ja.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -153,7 +153,7 @@ FONT 9, "MS Shell Dlg" BEGIN GROUPBOX "ã¿ãã®åæ¢ä½ç½®(&T)", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "追å (&A)", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "åé¤(&R)", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Ko.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Ko.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Ko.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -152,7 +152,7 @@ FONT 9, "MS Shell Dlg" BEGIN GROUPBOX "ÅÇ Á¤Áö", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "´õÇϱâ(&A)", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "Áö¿ì±â(&R)", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "È®ÀÎ(&O)", IDOK, 137, 15, 50, 15 @@ -242,4 +242,5 @@ STRING_OPEN_FAILED, "ÆÄÀÏÀ» ¿ ¼ö ¾ø½À´Ï´Ù." STRING_OPEN_ACCESS_DENIED, "ÆÄÀÏÀ» ¿ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù." STRING_PRINTING_NOT_IMPLEMENTED, "Àμâ´Â Áö¿øµÇÁö ¾Ê½À´Ï´Ù" -END + STRING_MAX_TAB_STOPS, " ÅÇÁßÁö´Â 32°³ ÀÌ»ó Ãß°¡ ÇÒ ¼ö ¾ø½À´Ï´Ù." +END Modified: trunk/reactos/base/applications/wordpad/Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Nl.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Nl.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -151,7 +151,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tab stops", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Toevoegen", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Verwijderen", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/No.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/No.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -150,7 +150,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tabulatorstopp", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Legg til", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Fjern", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Pl.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Pl.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -151,7 +151,7 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Pozycje tabulatorów", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Dodaj", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Usuñ", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 57, 15 Modified: trunk/reactos/base/applications/wordpad/Pt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Pt.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Pt.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -152,7 +152,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Marca de tabulação", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Adicionar", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Remover", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 135, 15, 55, 15 Modified: trunk/reactos/base/applications/wordpad/Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Ru.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Ru.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -150,7 +150,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Ïîçèöèè òàáóëÿöèè", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Óñòàíîâèòü", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "Î&÷èñòèòü", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&ÎÊ", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Si.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Si.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -152,7 +152,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Položaji tabulatorja", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Dodaj", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Odstrani", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&V redu", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Sv.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Sv.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -152,7 +152,7 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Tabulatorstopp", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "Lägg &till", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "Ta &bort", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Tr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Tr.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Tr.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -152,7 +152,7 @@ FONT 8, "MS SHell DLg" BEGIN GROUPBOX "Tab stops", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Add", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Remove", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/Zh.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/Zh.rc [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -155,7 +155,7 @@ FONT 9, "MS Shell Dlg" BEGIN GROUPBOX "æ ç¾åç¹", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "æ·»å (&A)", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "å é¤(&R)", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "ç¡®å®(&O)", IDOK, 137, 15, 50, 15 @@ -380,7 +380,7 @@ FONT 9, "MS Shell Dlg" BEGIN GROUPBOX "æ¨ç±¤åé»", -1, 10, 10, 120, 90 - COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "æ·»å (&A)", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "åªé¤(&R)", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "確å®(&O)", IDOK, 137, 15, 50, 15 Modified: trunk/reactos/base/applications/wordpad/wordpad.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -1636,15 +1636,36 @@ if(SendMessageW(hTabWnd, CB_FINDSTRINGEXACT, -1, (LPARAM)&buffer) == CB_ERR) { float number = 0; + int item_count = SendMessage(hTabWnd, CB_GETCOUNT, 0, 0); if(!number_from_string(buffer, &number, TRUE)) { MessageBoxWithResStringW(hWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), wszAppTitle, MB_OK | MB_ICONINFORMATION); - } else - { - SendMessageW(hTabWnd, CB_ADDSTRING, 0, (LPARAM)&buffer); - SetWindowTextW(hTabWnd, 0); + } else if (item_count >= MAX_TAB_STOPS) { + MessageBoxWithResStringW(hWnd, MAKEINTRESOURCEW(STRING_MAX_TAB_STOPS), + wszAppTitle, MB_OK | MB_ICONINFORMATION); + } else { + int i; + float next_number = -1; + int next_number_in_twips = -1; + int insert_number = current_units_to_twips(number); + + /* linear search for position to insert the string */ + for(i = 0; i < item_count; i++) + { + SendMessageW(hTabWnd, CB_GETLBTEXT, i, (LPARAM)&buffer); + number_from_string(buffer, &next_number, TRUE); + next_number_in_twips = current_units_to_twips(next_number); + if (insert_number <= next_number_in_twips) + break; + } + if (insert_number != next_number_in_twips) + { + number_with_units(buffer, insert_number); + SendMessageW(hTabWnd, CB_INSERTSTRING, i, (LPARAM)&buffer); + SetWindowTextW(hTabWnd, 0); + } } } SetFocus(hTabWnd); Modified: trunk/reactos/base/applications/wordpad/wordpad.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/wordpad.h [iso-8859-1] Wed Mar 11 15:11:28 2009 @@ -200,6 +200,7 @@ #define STRING_OPEN_FAILED 1709 #define STRING_OPEN_ACCESS_DENIED 1710 #define STRING_PRINTING_NOT_IMPLEMENTED 1711 +#define STRING_MAX_TAB_STOPS 1712 LPWSTR file_basename(LPWSTR);
15 years, 9 months
1
0
0
0
[dchapyshev] 39949: - Add Russian translation
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Mar 11 14:14:05 2009 New Revision: 39949 URL:
http://svn.reactos.org/svn/reactos?rev=39949&view=rev
Log: - Add Russian translation Added: trunk/reactos/base/applications/mplay32/lang/ru-RU.rc (with props) Modified: trunk/reactos/base/applications/mplay32/rsrc.rc Added: trunk/reactos/base/applications/mplay32/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/lang/ru-RU.rc (added) +++ trunk/reactos/base/applications/mplay32/lang/ru-RU.rc [iso-8859-1] Wed Mar 11 14:14:05 2009 @@ -1,0 +1,29 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +IDR_MAINMENU MENU +BEGIN + POPUP "&Ôàéë" + BEGIN + MENUITEM "&Îòêðûòü...", IDM_OPEN_FILE + MENUITEM "&Çàêðûòü", IDM_CLOSE_FILE + MENUITEM SEPARATOR + MENUITEM "&Âûõîä", IDM_EXIT + END + POPUP "&Ïîìîùü" + BEGIN + MENUITEM "&Î ïðîãðàììå...", IDM_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALL_TYPES_FILTER "Âñå ïîääåðæèâàåìûå (*.wav, *.cda, *.midi, *.mid, *.avi)\0*.wav;*.cda;*.midi;*.mid;*.avi\0" + IDS_TOOLTIP_PLAY "Âîñïðîèçâåäåíèå" + IDS_TOOLTIP_STOP "Îñòàíîâèòü" + IDS_TOOLTIP_EJECT "Èçâëå÷ü" + IDS_TOOLTIP_BACKWARD "Íàçàä" + IDS_TOOLTIP_SEEKBACK "Ïåðåìîòêà íàçàä" + IDS_TOOLTIP_SEEKFORW "Ïåðåìîòêà âïåðåä" + IDS_TOOLTIP_FORWARD "Âïåðåä" + IDS_APPTITLE "Ïðîèãðûâàòåëü ReactOS" +END Propchange: trunk/reactos/base/applications/mplay32/lang/ru-RU.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/mplay32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] Wed Mar 11 14:14:05 2009 @@ -2,3 +2,4 @@ #include "resource.h" #include "lang/en-US.rc" +#include "lang/ru-RU.rc"
15 years, 9 months
1
0
0
0
[dchapyshev] 39948: - Add mplay32 to bootcd - Opening .wav, .cda, .avi, .mid files with mplay32
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Mar 11 13:57:05 2009 New Revision: 39948 URL:
http://svn.reactos.org/svn/reactos?rev=39948&view=rev
Log: - Add mplay32 to bootcd - Opening .wav, .cda, .avi, .mid files with mplay32 Modified: trunk/reactos/base/applications/mplay32/mplay32.c trunk/reactos/boot/bootdata/hivecls_arm.inf trunk/reactos/boot/bootdata/hivecls_i386.inf trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/base/applications/mplay32/mplay32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Wed Mar 11 13:57:05 2009 @@ -419,7 +419,6 @@ if (GetFileAttributes(szLocalFileName) == INVALID_FILE_ATTRIBUTES) { - MessageBox(hwnd, _T("Wrong path to a file!"), NULL, MB_OK); return; } @@ -689,6 +688,8 @@ ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); + PlayFile(hwnd, lpCmdLine); + /* Message Loop */ while (GetMessage(&msg, NULL, 0, 0)) { Modified: trunk/reactos/boot/bootdata/hivecls_arm.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls_arm.…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls_arm.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivecls_arm.inf [iso-8859-1] Wed Mar 11 13:57:05 2009 @@ -270,11 +270,26 @@ HKCR,".wav","",0x00000000,"SoundRec" HKCR,"SoundRec","",0x00000000,"Wave Sound" HKCR,"SoundRec\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" +HKCR,"SoundRec\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" + +; Midi Sounds +HKCR,".mid","",0x00000000,"MIDFile" +HKCR,".midi","",0x00000000,"MIDFile" +HKCR,"MIDFile","",0x00000000,"MIDI Sequence" +HKCR,"MIDFile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" +HKCR,"MIDFile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" + +; Audio CD +HKCR,".cda","",0x00000000,"CDAFile" +HKCR,"CDAFile","",0x00000000,"CD Audio Track" +HKCR,"CDAFile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" +HKCR,"CDAFile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" ; Avi Files HKCR,".avi","",0x00000000,"AVIFile" HKCR,"AVIFile","",0x00000000,"Video Clip" HKCR,"AVIFile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-224" +HKCR,"AVIFile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" HKCR,"CLSID",,0x00000012 Modified: trunk/reactos/boot/bootdata/hivecls_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivecls_i386.inf [iso-8859-1] Wed Mar 11 13:57:05 2009 @@ -266,11 +266,26 @@ HKCR,".wav","",0x00000000,"SoundRec" HKCR,"SoundRec","",0x00000000,"Wave Sound" HKCR,"SoundRec\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" +HKCR,"SoundRec\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" + +; Midi Sounds +HKCR,".mid","",0x00000000,"MIDFile" +HKCR,".midi","",0x00000000,"MIDFile" +HKCR,"MIDFile","",0x00000000,"MIDI Sequence" +HKCR,"MIDFile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" +HKCR,"MIDFile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" + +; Audio CD +HKCR,".cda","",0x00000000,"CDAFile" +HKCR,"CDAFile","",0x00000000,"CD Audio Track" +HKCR,"CDAFile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" +HKCR,"CDAFile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" ; Avi Files HKCR,".avi","",0x00000000,"AVIFile" HKCR,"AVIFile","",0x00000000,"Video Clip" HKCR,"AVIFile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-224" +HKCR,"AVIFile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mplay32.exe %1" HKCR,"CLSID",,0x00000012 Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Wed Mar 11 13:57:05 2009 @@ -50,6 +50,7 @@ base\applications\kbswitch\kbswitch.exe 1 base\applications\kbswitch\kbsdll\kbsdll.dll 1 base\applications\logoff\logoff.exe 1 +base\applications\mplay32\mplay32.exe 1 base\applications\msconfig\msconfig.exe 1 base\applications\mstsc\mstsc.exe 1 base\applications\network\arp\arp.exe 1
15 years, 9 months
1
0
0
0
[dchapyshev] 39947: - Add simple multimedia player
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Mar 11 13:22:15 2009 New Revision: 39947 URL:
http://svn.reactos.org/svn/reactos?rev=39947&view=rev
Log: - Add simple multimedia player Added: trunk/reactos/base/applications/mplay32/ (with props) trunk/reactos/base/applications/mplay32/lang/ (with props) trunk/reactos/base/applications/mplay32/lang/en-US.rc (with props) trunk/reactos/base/applications/mplay32/mplay32.c (with props) trunk/reactos/base/applications/mplay32/mplay32.h (with props) trunk/reactos/base/applications/mplay32/mplay32.rbuild (with props) trunk/reactos/base/applications/mplay32/mplay32.rc (with props) trunk/reactos/base/applications/mplay32/resource.h (with props) trunk/reactos/base/applications/mplay32/resources/ (with props) trunk/reactos/base/applications/mplay32/resources/backward.bmp (with props) trunk/reactos/base/applications/mplay32/resources/eject.bmp (with props) trunk/reactos/base/applications/mplay32/resources/forward.bmp (with props) trunk/reactos/base/applications/mplay32/resources/mplay32.ico (with props) trunk/reactos/base/applications/mplay32/resources/pause.bmp (with props) trunk/reactos/base/applications/mplay32/resources/play.bmp (with props) trunk/reactos/base/applications/mplay32/resources/seekback.bmp (with props) trunk/reactos/base/applications/mplay32/resources/seekforw.bmp (with props) trunk/reactos/base/applications/mplay32/resources/stop.bmp (with props) trunk/reactos/base/applications/mplay32/rsrc.rc (with props) Modified: trunk/reactos/base/applications/applications.rbuild Modified: trunk/reactos/base/applications/applications.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/applicat…
============================================================================== --- trunk/reactos/base/applications/applications.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/applications.rbuild [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -33,6 +33,9 @@ </directory> <directory name="logoff"> <xi:include href="logoff/logoff.rbuild" /> + </directory> + <directory name="mplay32"> + <xi:include href="mplay32/mplay32.rbuild" /> </directory> <directory name="msconfig"> <xi:include href="msconfig/msconfig.rbuild" /> Propchange: trunk/reactos/base/applications/mplay32/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Mar 11 13:22:15 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/base/applications/mplay32/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/base/applications/mplay32/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/applications/mplay32/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Propchange: trunk/reactos/base/applications/mplay32/lang/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Mar 11 13:22:15 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/base/applications/mplay32/lang/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/base/applications/mplay32/lang/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/applications/mplay32/lang/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/base/applications/mplay32/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/lang/en-US.rc (added) +++ trunk/reactos/base/applications/mplay32/lang/en-US.rc [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,29 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +IDR_MAINMENU MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Open...", IDM_OPEN_FILE + MENUITEM "&Close", IDM_CLOSE_FILE + MENUITEM SEPARATOR + MENUITEM "&Exit", IDM_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About...", IDM_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALL_TYPES_FILTER "All Supported (*.wav, *.cda, *.midi, *.mid, *.avi)\0*.wav;*.cda;*.midi;*.mid;*.avi\0" + IDS_TOOLTIP_PLAY "Play" + IDS_TOOLTIP_STOP "Stop" + IDS_TOOLTIP_EJECT "Eject" + IDS_TOOLTIP_BACKWARD "Skip Backward" + IDS_TOOLTIP_SEEKBACK "Seek Backward" + IDS_TOOLTIP_SEEKFORW "Seek Forward" + IDS_TOOLTIP_FORWARD "Skip Forward" + IDS_APPTITLE "ReactOS Multimedia Player" +END Propchange: trunk/reactos/base/applications/mplay32/lang/en-US.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mplay32/mplay32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/mplay32.c (added) +++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,700 @@ +/* + * PROJECT: ReactOS Multimedia Player + * FILE: base\applications\mplay32\mplay32.c + * PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org) + */ + +#include "mplay32.h" + +#define MAIN_WINDOW_HEIGHT 125 +#define MAIN_WINDOW_MIN_WIDTH 250 + +HINSTANCE hInstance = NULL; +HWND hTrackBar = NULL; +HWND hToolBar = NULL; +TCHAR szAppTitle[256] = _T(""); +TCHAR szPrevFile[MAX_PATH] = _T("\0"); +WORD wDeviceId; +BOOL bIsOpened = FALSE; +BOOL bIsPaused = FALSE; +UINT MaxFilePos = 0; + +/* Known types table */ +static const TYPEBYEXT ExtTypes[] = +{ + { _T(".wav"), WAVE_FILE }, + { _T(".wave"), WAVE_FILE }, + { _T(".mid"), MIDI_FILE }, + { _T(".midi"), MIDI_FILE }, + { _T(".cda"), AUDIOCD_FILE }, + { _T(".avi"), AVI_FILE }, + { _T("\0"), 0 } +}; + +/* ToolBar Buttons */ +static const TBBUTTON Buttons[] = +{ /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */ + {TBICON_PLAY, IDC_PLAY, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_STOP, IDC_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_EJECT, IDC_EJECT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, + {TBICON_BACKWARD, IDC_BACKWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_SEEKBACK, IDC_SEEKBACK, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_SEEKFORW, IDC_SEEKFORW, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_FORWARD, IDC_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0} +}; + +static VOID +SetImageList(HWND hwnd) +{ + HIMAGELIST hImageList; + + hImageList = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR24, 1, 1); + + if (!hImageList) + { + MessageBox(hwnd, _T("ImageList it is not created!"), NULL, MB_OK); + return; + } + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_PLAYICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_STOPICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_EJECTICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_BACKWARDICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_SEEKBACKICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_SEEKFORWICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, + LoadImage(hInstance, MAKEINTRESOURCE(IDB_FORWARDICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR), + RGB(255, 255, 255)); + + ImageList_Destroy((HIMAGELIST)SendMessage(hToolBar, + TB_SETIMAGELIST, + 0, + (LPARAM)hImageList)); +} + +static VOID +InitControls(HWND hwnd) +{ + INT NumButtons = sizeof(Buttons) / sizeof(Buttons[0]); + + InitCommonControls(); + + /* Create trackbar */ + hTrackBar = CreateWindowEx(0, + TRACKBAR_CLASS, + NULL, + TBS_ENABLESELRANGE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPSIBLINGS, + 0, + 0, + 340, + 30, + hwnd, + NULL, + hInstance, + NULL); + if (!hTrackBar) + { + MessageBox(hwnd, _T("TrackBar it is not created!"), NULL, MB_OK); + return; + } + + /* Create toolbar */ + hToolBar = CreateWindowEx(0, + TOOLBARCLASSNAME, + NULL, + WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPSIBLINGS | + TBSTYLE_FLAT | CCS_BOTTOM | TBSTYLE_TOOLTIPS, + 0, + 40, + 340, + 30, + hwnd, + NULL, + hInstance, + NULL); + if (!hToolBar) + { + MessageBox(hwnd, _T("ToolBar it is not created!"), NULL, MB_OK); + return; + } + + SetImageList(hwnd); + SendMessage(hToolBar, TB_ADDBUTTONS, NumButtons, (LPARAM)Buttons); +} + +static UINT +IsSupportedFileExtension(LPWSTR lpFileName) +{ + TCHAR szExt[MAX_PATH]; + INT DotPos = 0, i, j; + + for (i = _tcslen(lpFileName); i >= 0; --i) + { + if (lpFileName[i] == '.') + { + DotPos = _tcslen(lpFileName) - i; + break; + } + } + + if (!DotPos) return UNSUPPORTED_FILE; + + szExt[DotPos + 1] = _T('\0'); + for (i = _tcslen(lpFileName), j = DotPos; j >= 0; --i, --j) + { + szExt[j] = lpFileName[i]; + } + + for (i = 0; ; i++) + { + if (ExtTypes[i].uType == UNSUPPORTED_FILE) + { + return UNSUPPORTED_FILE; + } + + if (_tcscmp(ExtTypes[i].szExt, szExt) == 0) + { + return ExtTypes[i].uType; + } + } + + return UNSUPPORTED_FILE; +} + +static DWORD +CloseMciDevice(VOID) +{ + MCI_GENERIC_PARMS mciGeneric; + DWORD dwError; + + if (bIsOpened) + { + dwError = mciSendCommand(wDeviceId, MCI_CLOSE, MCI_WAIT, (DWORD)(LPMCI_GENERIC_PARMS)&mciGeneric); + if (dwError) return dwError; + bIsOpened = FALSE; + } + + return TRUE; +} + +static DWORD +OpenMciDevice(LPTSTR lpType, LPTSTR lpFileName) +{ + MCI_STATUS_PARMS mciStatus; + MCI_OPEN_PARMS mciOpen; + DWORD dwError; + + if (bIsOpened) + { + CloseMciDevice(); + } + + mciOpen.lpstrDeviceType = lpType; + mciOpen.lpstrElementName = lpFileName; + mciOpen.dwCallback = 0; + mciOpen.wDeviceID = 0; + mciOpen.lpstrAlias = NULL; + + dwError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT, (DWORD)(LPVOID)&mciOpen); + if (dwError != 0) + { + MessageBox(0, _T("Can't open device! (1)"), NULL, MB_OK); + return dwError; + } + + mciStatus.dwItem = MCI_STATUS_LENGTH; + + dwError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatus); + if (dwError != 0) + { + MessageBox(0, _T("Can't open device! (2)"), NULL, MB_OK); + return dwError; + } + + SendMessage(hTrackBar, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG(1, mciStatus.dwReturn)); + SendMessage(hTrackBar, TBM_SETPAGESIZE, 0, 10); + SendMessage(hTrackBar, TBM_SETLINESIZE, 0, 1); + SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 1); + + if (mciStatus.dwReturn < 10000) + { + SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100, (LPARAM) 0); + } + else if (mciStatus.dwReturn < 100000) + { + SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 1000, (LPARAM) 0); + } + else if (mciStatus.dwReturn < 1000000) + { + SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 10000, (LPARAM) 0); + } + else + { + SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100000, (LPARAM) 0); + } + + MaxFilePos = mciStatus.dwReturn; + wDeviceId = mciOpen.wDeviceID; + bIsOpened = TRUE; + lstrcpy(szPrevFile, lpFileName); + return TRUE; +} + +static VOID +StopPlayback(HWND hwnd) +{ + if (bIsOpened) + { + SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 1); + KillTimer(hwnd, IDT_PLAYTIMER); + CloseMciDevice(); + } +} + +static VOID +SeekPlayback(HWND hwnd, DWORD dwNewPos) +{ + MCI_SEEK_PARMS mciSeek; + MCI_PLAY_PARMS mciPlay; + DWORD dwError; + + if (bIsOpened) + { + mciSeek.dwTo = dwNewPos; + dwError = mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_TO, (DWORD)(LPVOID)&mciSeek); + if (dwError != 0) + { + MessageBox(hwnd, _T("SeekPlayback: Can't seek!"), NULL, MB_OK); + } + + mciPlay.dwCallback = (DWORD)hwnd; + dwError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY, (DWORD)(LPVOID)&mciPlay); + if (dwError != 0) + { + MessageBox(hwnd, _T("SeekPlayback: Can't play!"), NULL, MB_OK); + } + } +} + +static VOID +SeekBackPlayback(HWND hwnd) +{ + MCI_STATUS_PARMS mciStatus; + DWORD dwNewPos; + + if (!bIsOpened) return; + + mciStatus.dwItem = MCI_STATUS_POSITION; + mciSendCommand(wDeviceId, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)(LPVOID)&mciStatus); + + dwNewPos = mciStatus.dwReturn - 1; + + if((UINT)dwNewPos <= 1) + { + StopPlayback(hwnd); + } + else + { + SeekPlayback(hwnd, dwNewPos); + } +} + +static VOID +SeekForwPlayback(HWND hwnd) +{ + MCI_STATUS_PARMS mciStatus; + DWORD dwNewPos; + + if (!bIsOpened) return; + + mciStatus.dwItem = MCI_STATUS_POSITION; + mciSendCommand(wDeviceId, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)(LPVOID)&mciStatus); + + dwNewPos = mciStatus.dwReturn + 1; + + if((UINT)dwNewPos >= MaxFilePos) + { + StopPlayback(hwnd); + } + else + { + SeekPlayback(hwnd, dwNewPos); + } +} + +static VOID +PausePlayback(HWND hwnd) +{ + MCI_GENERIC_PARMS mciGeneric; + DWORD dwError; + + if (bIsOpened) + { + dwError = mciSendCommand(wDeviceId, MCI_PAUSE, MCI_WAIT, (DWORD)(LPMCI_GENERIC_PARMS)&mciGeneric); + if (dwError != 0) + { + MessageBox(hwnd, _T("Can't pause!"), NULL, MB_OK); + } + bIsPaused = TRUE; + } +} + +static VOID +ResumePlayback(HWND hwnd) +{ + MCI_GENERIC_PARMS mciGeneric; + DWORD dwError; + + if (bIsPaused) + { + dwError = mciSendCommand(wDeviceId, MCI_RESUME, MCI_WAIT, (DWORD)(LPMCI_GENERIC_PARMS)&mciGeneric); + if (dwError != 0) + { + MessageBox(hwnd, _T("Can't resume!"), NULL, MB_OK); + } + bIsPaused = FALSE; + } +} + +VOID CALLBACK +PlayTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) +{ + MCI_STATUS_PARMS mciStatus; + DWORD dwPos; + + if (!bIsOpened) KillTimer(hwnd, IDT_PLAYTIMER); + + mciStatus.dwItem = MCI_STATUS_POSITION; + mciSendCommand(wDeviceId, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)(LPVOID)&mciStatus); + dwPos = mciStatus.dwReturn; + + if((UINT)dwPos >= MaxFilePos) + { + StopPlayback(hwnd); + } + else + { + SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) dwPos); + } +} + +static VOID +PlayFile(HWND hwnd, LPWSTR lpFileName) +{ + MCI_PLAY_PARMS mciPlay; + TCHAR szLocalFileName[MAX_PATH]; + UINT FileType; + DWORD dwError; + + if (lpFileName == NULL) + { + if (szPrevFile[0] == _T('\0')) + return; + + lstrcpy(szLocalFileName, szPrevFile); + } + else + { + lstrcpy(szLocalFileName, lpFileName); + } + + if (GetFileAttributes(szLocalFileName) == INVALID_FILE_ATTRIBUTES) + { + MessageBox(hwnd, _T("Wrong path to a file!"), NULL, MB_OK); + return; + } + + FileType = IsSupportedFileExtension(szLocalFileName); + + switch (FileType) + { + case UNSUPPORTED_FILE: + MessageBox(hwnd, _T("Unsupported format!"), NULL, MB_OK); + return; + case WAVE_FILE: + OpenMciDevice(_T("waveaudio"), szLocalFileName); + break; + case MIDI_FILE: + OpenMciDevice(_T("sequencer"), szLocalFileName); + break; + case AUDIOCD_FILE: + OpenMciDevice(_T("cdaudio"), szLocalFileName); + break; + case AVI_FILE: + OpenMciDevice(_T("avivideo"), szLocalFileName); + break; + } + + SetTimer(hwnd, IDT_PLAYTIMER, 100, (TIMERPROC) PlayTimerProc); + + dwError = mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_SEEK_TO_START, 0); + + mciPlay.dwCallback = (DWORD)hwnd; + mciPlay.dwFrom = 0; + mciPlay.dwTo = MaxFilePos; + + dwError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD)(LPVOID)&mciPlay); + if (dwError != 0) + { + MessageBox(hwnd, _T("Can't play!"), NULL, MB_OK); + } +} + +static VOID +OpenFileDialog(HWND hwnd) +{ + OPENFILENAME OpenFileName; + TCHAR szFile[MAX_PATH + 1] = _T("\0"); + TCHAR szFilter[MAX_PATH], szCurrentDir[MAX_PATH]; + + ZeroMemory(&OpenFileName, sizeof(OpenFileName)); + + LoadString(hInstance, IDS_ALL_TYPES_FILTER, szFilter, sizeof(szFilter) / sizeof(TCHAR)); + + if (!GetCurrentDirectory(sizeof(szCurrentDir) / sizeof(TCHAR), szCurrentDir)) + { + lstrcpy(szCurrentDir, _T("c:\\")); + } + + OpenFileName.lStructSize = sizeof(OpenFileName); + OpenFileName.hwndOwner = hwnd; + OpenFileName.hInstance = hInstance; + OpenFileName.lpstrFilter = szFilter; + OpenFileName.lpstrFile = szFile; + OpenFileName.nMaxFile = sizeof(szFile) / sizeof((szFile)[0]); + OpenFileName.lpstrInitialDir = szCurrentDir; + OpenFileName.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_SHAREAWARE; + OpenFileName.lpstrDefExt = _T("\0"); + + if (GetOpenFileName(&OpenFileName)) + { + PlayFile(hwnd, OpenFileName.lpstrFile); + } +} + +LRESULT CALLBACK +MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) +{ + switch (Message) + { + case WM_CREATE: + InitControls(hwnd); + break; + + case WM_NOTIFY: + { + LPNMHDR pnmhdr = (LPNMHDR)lParam; + + switch (pnmhdr->code) + { + case TTN_GETDISPINFO: + { + LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)lParam; + UINT idButton = (UINT)lpttt->hdr.idFrom; + + switch (idButton) + { + case IDC_PLAY: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PLAY); + break; + case IDC_STOP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_STOP); + break; + case IDC_EJECT: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EJECT); + break; + case IDC_BACKWARD: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_BACKWARD); + break; + case IDC_SEEKBACK: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_SEEKBACK); + break; + case IDC_SEEKFORW: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_SEEKFORW); + break; + case IDC_FORWARD: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_FORWARD); + break; + } + break; + } + } + } + break; + + case WM_SIZING: + { + LPRECT pRect = (LPRECT)lParam; + + if (pRect->right - pRect->left < MAIN_WINDOW_MIN_WIDTH) + pRect->right = pRect->left + MAIN_WINDOW_MIN_WIDTH; + + if (pRect->bottom - pRect->top != MAIN_WINDOW_HEIGHT) + pRect->bottom = pRect->top + MAIN_WINDOW_HEIGHT; + + return TRUE; + } + + case WM_SIZE: + { + RECT Rect; + UINT Size; + + if (hToolBar && hTrackBar) + { + SendMessage(hToolBar, TB_AUTOSIZE, 0, 0); + SendMessage(hToolBar, TB_GETITEMRECT, 1, (LPARAM)&Rect); + + Size = GetSystemMetrics(SM_CYMENU) + Rect.bottom; + MoveWindow(hTrackBar, 0, 0, LOWORD(lParam), HIWORD(lParam) - Size, TRUE); + } + return 0L; + } + + case WM_HSCROLL: + { + if (hTrackBar == (HWND) lParam) + { + DWORD dwNewPos = (DWORD) SendMessage(hTrackBar, TBM_GETPOS, 0, 0); + SeekPlayback(hwnd, dwNewPos); + } + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_PLAY: + if (bIsOpened) + { + if (bIsPaused) + ResumePlayback(hwnd); + else + PausePlayback(hwnd); + } + else + { + if (szPrevFile[0] == _T('\0')) + OpenFileDialog(hwnd); + else + PlayFile(hwnd, NULL); + } + break; + + case IDC_STOP: + StopPlayback(hwnd); + break; + + case IDC_EJECT: + break; + + case IDC_BACKWARD: + break; + + case IDC_SEEKBACK: + SeekBackPlayback(hwnd); + break; + + case IDC_SEEKFORW: + SeekForwPlayback(hwnd); + break; + + case IDC_FORWARD: + break; + + case IDM_OPEN_FILE: + OpenFileDialog(hwnd); + return 0; + + case IDM_CLOSE_FILE: + StopPlayback(hwnd); + lstrcpy(szPrevFile, _T("\0")); + break; + + case IDM_ABOUT: + ShellAbout(hwnd, szAppTitle, 0, 0); + break; + + case IDM_EXIT: + PostMessage(hwnd, WM_CLOSE, 0, 0); + return 0; + } + break; + + case WM_DESTROY: + StopPlayback(hwnd); + PostQuitMessage(0); + return 0; + } + + return DefWindowProc(hwnd, Message, wParam, lParam); +} + +INT WINAPI +_tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdShow) +{ + WNDCLASSEX WndClass = {0}; + TCHAR szClassName[] = _T("ROSMPLAY32"); + HWND hwnd; + MSG msg; + + hInstance = hInst; + + LoadString(hInstance, IDS_APPTITLE, szAppTitle, sizeof(szAppTitle) / sizeof(TCHAR)); + + WndClass.cbSize = sizeof(WNDCLASSEX); + WndClass.lpszClassName = szClassName; + WndClass.lpfnWndProc = MainWndProc; + WndClass.hInstance = hInstance; + WndClass.style = CS_HREDRAW | CS_VREDRAW; + WndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAIN)); + WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); + WndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + WndClass.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU); + + RegisterClassEx(&WndClass); + + hwnd = CreateWindow(szClassName, + szAppTitle, + WS_SYSMENU | WS_MINIMIZEBOX | WS_THICKFRAME | WS_OVERLAPPED | WS_CAPTION | WS_CLIPCHILDREN, + CW_USEDEFAULT, + CW_USEDEFAULT, + 350, + MAIN_WINDOW_HEIGHT, + NULL, + NULL, + hInstance, + NULL); + + /* Show it */ + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + + /* Message Loop */ + while (GetMessage(&msg, NULL, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return 0; +} Propchange: trunk/reactos/base/applications/mplay32/mplay32.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mplay32/mplay32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/mplay32.h (added) +++ trunk/reactos/base/applications/mplay32/mplay32.h [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,19 @@ +#include <windows.h> +#include <commctrl.h> +#include <tchar.h> + +#include "resource.h" + +#define IDT_PLAYTIMER 1000 + +#define UNSUPPORTED_FILE 0 +#define WAVE_FILE 1 +#define MIDI_FILE 2 +#define AUDIOCD_FILE 3 +#define AVI_FILE 4 + +typedef struct +{ + TCHAR szExt[MAX_PATH]; + UINT uType; +} TYPEBYEXT; Propchange: trunk/reactos/base/applications/mplay32/mplay32.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mplay32/mplay32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/mplay32.rbuild (added) +++ trunk/reactos/base/applications/mplay32/mplay32.rbuild [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,12 @@ +<module name="mplay32" type="win32gui" installbase="system32" installname="mplay32.exe" unicode="yes"> + <include base="mplay32">.</include> + <library>advapi32</library> + <library>comctl32</library> + <library>comdlg32</library> + <library>kernel32</library> + <library>user32</library> + <library>winmm</library> + <library>shell32</library> + <file>mplay32.c</file> + <file>mplay32.rc</file> +</module> Propchange: trunk/reactos/base/applications/mplay32/mplay32.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mplay32/mplay32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/mplay32.rc (added) +++ trunk/reactos/base/applications/mplay32/mplay32.rc [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,24 @@ +#include <windows.h> +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Multimedia Player\0" +#define REACTOS_STR_INTERNAL_NAME "mplay32\0" +#define REACTOS_STR_ORIGINAL_FILENAME "mplay32.exe\0" +#include <reactos/version.rc> + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +/* Icons */ +IDI_MAIN ICON DISCARDABLE "resources/mplay32.ico" + +/* Bitmaps */ +IDB_PLAYICON BITMAP "resources/play.bmp" +IDB_STOPICON BITMAP "resources/stop.bmp" +IDB_EJECTICON BITMAP "resources/eject.bmp" +IDB_BACKWARDICON BITMAP "resources/backward.bmp" +IDB_SEEKBACKICON BITMAP "resources/seekback.bmp" +IDB_SEEKFORWICON BITMAP "resources/seekforw.bmp" +IDB_FORWARDICON BITMAP "resources/forward.bmp" +IDB_PAUSEICON BITMAP "resources/pause.bmp" + +#include "rsrc.rc" Propchange: trunk/reactos/base/applications/mplay32/mplay32.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mplay32/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/resource.h (added) +++ trunk/reactos/base/applications/mplay32/resource.h [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,55 @@ +#ifndef __RESOURCE_H_ +#define __RESOURCE_H_ + +/* Icons */ +#define IDI_MAIN 10 + +/* Bitmaps */ +#define IDB_PLAYICON 50 +#define IDB_STOPICON 51 +#define IDB_EJECTICON 52 +#define IDB_BACKWARDICON 53 +#define IDB_SEEKBACKICON 54 +#define IDB_SEEKFORWICON 55 +#define IDB_FORWARDICON 56 +#define IDB_PAUSEICON 57 + +/* Strings */ +#define IDS_APPTITLE 100 +#define IDS_TOOLTIP_PLAY 101 +#define IDS_TOOLTIP_STOP 102 +#define IDS_TOOLTIP_EJECT 103 +#define IDS_TOOLTIP_BACKWARD 104 +#define IDS_TOOLTIP_SEEKBACK 105 +#define IDS_TOOLTIP_SEEKFORW 106 +#define IDS_TOOLTIP_FORWARD 107 +#define IDS_ALL_TYPES_FILTER 108 + +/* Menu */ +#define IDR_MAINMENU 500 + +/* Menu items */ +#define IDM_OPEN_FILE 1000 +#define IDM_CLOSE_FILE 1001 +#define IDM_EXIT 1002 +#define IDM_ABOUT 1003 + +/* ToolBar Icons */ +#define TBICON_PLAY 0 +#define TBICON_STOP 1 +#define TBICON_EJECT 2 +#define TBICON_BACKWARD 3 +#define TBICON_SEEKBACK 4 +#define TBICON_SEEKFORW 5 +#define TBICON_FORWARD 6 + +/* ToolBar Buttons */ +#define IDC_PLAY 1500 +#define IDC_STOP 1501 +#define IDC_EJECT 1502 +#define IDC_BACKWARD 1503 +#define IDC_SEEKBACK 1504 +#define IDC_SEEKFORW 1505 +#define IDC_FORWARD 1506 + +#endif /* __RESOURCE_H_ */ Propchange: trunk/reactos/base/applications/mplay32/resource.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/applications/mplay32/resources/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Mar 11 13:22:15 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/base/applications/mplay32/resources/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/base/applications/mplay32/resources/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/applications/mplay32/resources/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/base/applications/mplay32/resources/backward.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/backward.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/eject.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/eject.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/forward.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/forward.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/mplay32.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/mplay32.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/pause.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/pause.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/play.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/play.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/seekback.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/seekback.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/seekforw.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/seekforw.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/resources/stop.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mplay32/resources/stop.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mplay32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
============================================================================== --- trunk/reactos/base/applications/mplay32/rsrc.rc (added) +++ trunk/reactos/base/applications/mplay32/rsrc.rc [iso-8859-1] Wed Mar 11 13:22:15 2009 @@ -1,0 +1,4 @@ +#include <windows.h> +#include "resource.h" + +#include "lang/en-US.rc" Propchange: trunk/reactos/base/applications/mplay32/rsrc.rc ------------------------------------------------------------------------------ svn:eol-style = native
15 years, 9 months
1
0
0
0
[janderwald] 39946: - Add kmixer to bootcd - Check if device supports a specified format. When the device doesnt support a format, query its datarange and create a format which it supports and create a kmixer pin which is used to convert the format - Load kmixer.sys when sysaudio starts - Call kmixer when there is work to do. - Bitrate increasing / decreasing is not working at all. (Need to find a working algorithm, volunteers?) - Install kmixer service when an audio adapter is installed
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 11 12:30:33 2009 New Revision: 39946 URL:
http://svn.reactos.org/svn/reactos?rev=39946&view=rev
Log: - Add kmixer to bootcd - Check if device supports a specified format. When the device doesnt support a format, query its datarange and create a format which it supports and create a kmixer pin which is used to convert the format - Load kmixer.sys when sysaudio starts - Call kmixer when there is work to do. - Bitrate increasing / decreasing is not working at all. (Need to find a working algorithm, volunteers?) - Install kmixer service when an audio adapter is installed Modified: trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c trunk/reactos/drivers/wdm/audio/sysaudio/control.c trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c trunk/reactos/drivers/wdm/audio/sysaudio/main.c trunk/reactos/drivers/wdm/audio/sysaudio/pin.c trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h trunk/reactos/media/inf/audio.inf Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -474,6 +474,7 @@ drivers\video\miniport\vbe\vbemp.sys 2 drivers\video\videoprt\videoprt.sys 2 +drivers\wdm\audio\filters\kmixer\kmixer.sys 2 drivers\wdm\audio\sysaudio\sysaudio.sys 2 drivers\wdm\audio\legacy\wdmaud\wdmaud.sys 2 drivers\wdm\audio\backpln\portcls\portcls.sys 2 Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -66,7 +66,7 @@ if (CurMapping->Irp) { - CurMapping->Irp->IoStatus.Information = CurMapping->Header->DataUsed; + CurMapping->Irp->IoStatus.Information = CurMapping->Header->FrameExtent; CurMapping->Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(CurMapping->Irp, IO_SOUND_INCREMENT); } Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -379,7 +379,9 @@ if (This->Stream) { - This->IrpQueue->lpVtbl->CancelBuffers(This->IrpQueue); + while(!This->IrpQueue->lpVtbl->CancelBuffers(This->IrpQueue)) + KeStallExecutionProcessor(10); + This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP); This->State = KSSTATE_STOP; @@ -680,7 +682,7 @@ //DPRINT1("Completing Irp %p\n", Packet->Irp); Packet->Irp->IoStatus.Status = STATUS_SUCCESS; - Packet->Irp->IoStatus.Information = Packet->Header.DataUsed; + Packet->Irp->IoStatus.Information = Packet->Header.FrameExtent; IoCompleteRequest(Packet->Irp, IO_SOUND_INCREMENT); StatusBlock->Status = STATUS_SUCCESS; } Modified: trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/filters/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -8,19 +8,172 @@ #include "kmixer.h" +const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; + +NTSTATUS +PerformQualityConversion( + PUCHAR Buffer, + ULONG BufferLength, + ULONG OldWidth, + ULONG NewWidth, + PVOID * Result, + PULONG ResultLength) +{ + ULONG Samples; + ULONG Index; + + ASSERT(OldWidth != NewWidth); + + /* FIXME + * This code does not work at all + */ + + Samples = BufferLength / (OldWidth / 8); + DPRINT1("Samples %u BufferLength %u\n", Samples, BufferLength); + + if (OldWidth == 8 && NewWidth == 16) + { + USHORT Sample; + PUSHORT BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(USHORT)); + if (!BufferOut) + return STATUS_INSUFFICIENT_RESOURCES; + + for(Index = 0; Index < Samples; Index++) + { + Sample = Buffer[Index]; + BufferOut[Index] = Sample * 256; + } + *Result = BufferOut; + *ResultLength = Samples * sizeof(USHORT); + DPRINT1("done\n"); + } + else if (OldWidth == 8 && NewWidth == 32) + { + PULONG BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(ULONG)); + if (!BufferOut) + return STATUS_INSUFFICIENT_RESOURCES; + + for(Index = 0; Index < Samples; Index++) + { + BufferOut[Index] = Buffer[Index] * 16777216; + } + *Result = BufferOut; + *ResultLength = Samples * sizeof(ULONG); + } + else if (OldWidth == 16 && NewWidth == 32) + { + PULONG BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(ULONG)); + if (!BufferOut) + return STATUS_INSUFFICIENT_RESOURCES; + + for(Index = 0; Index < Samples; Index++) + { + BufferOut[Index] = Buffer[Index] * 65536; + } + *Result = BufferOut; + *ResultLength = Samples * sizeof(ULONG); + } + + else if (OldWidth == 16 && NewWidth == 8) + { + PUCHAR BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(UCHAR)); + if (!BufferOut) + return STATUS_INSUFFICIENT_RESOURCES; + + for(Index = 0; Index < Samples; Index++) + { + BufferOut[Index] = (Buffer[Index] / 256) & 0xFF; + } + *Result = BufferOut; + *ResultLength = Samples * sizeof(UCHAR); + } + else if (OldWidth == 32 && NewWidth == 8) + { + PUCHAR BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(UCHAR)); + if (!BufferOut) + return STATUS_INSUFFICIENT_RESOURCES; + + for(Index = 0; Index < Samples; Index++) + { + BufferOut[Index] = (Buffer[Index] / 16777216) & 0xFF; + } + *Result = BufferOut; + *ResultLength = Samples * sizeof(UCHAR); + } + else if (OldWidth == 32 && NewWidth == 16) + { + PUSHORT BufferOut = ExAllocatePool(NonPagedPool, Samples * sizeof(USHORT)); + if (!BufferOut) + return STATUS_INSUFFICIENT_RESOURCES; + + for(Index = 0; Index < Samples; Index++) + { + BufferOut[Index] = (Buffer[Index] / 65536) & 0xFFFF; + } + *Result = BufferOut; + *ResultLength = Samples * sizeof(USHORT); + } + else + { + DPRINT1("Not implemented conversion OldWidth %u NewWidth %u\n", OldWidth, NewWidth); + return STATUS_NOT_IMPLEMENTED; + } + + return STATUS_SUCCESS; +} + + NTSTATUS NTAPI Pin_fnDeviceIoControl( PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION IoStack; + PKSPROPERTY Property; DPRINT1("Pin_fnDeviceIoControl called DeviceObject %p Irp %p\n", DeviceObject); - //TODO - // silverblade - // Perform Sample Rate Conversion - // Stream Mixing - // Up/down sampling + IoStack = IoGetCurrentIrpStackLocation(Irp); + + if (IoStack->Parameters.DeviceIoControl.InputBufferLength == sizeof(KSPROPERTY) && IoStack->Parameters.DeviceIoControl.OutputBufferLength == sizeof(KSDATAFORMAT_WAVEFORMATEX)) + { + Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; + + if (IsEqualGUIDAligned(&Property->Set, &KSPROPSETID_Connection)) + { + if (Property->Id == KSPROPERTY_CONNECTION_DATAFORMAT && Property->Flags == KSPROPERTY_TYPE_SET) + { + PKSDATAFORMAT_WAVEFORMATEX WaveFormat2; + PKSDATAFORMAT_WAVEFORMATEX WaveFormat = ExAllocatePool(NonPagedPool, sizeof(KSDATAFORMAT_WAVEFORMATEX)); + + if (!WaveFormat) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_NO_MEMORY; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_NO_MEMORY; + } + + if (IoStack->FileObject->FsContext2) + { + ExFreePool(IoStack->FileObject->FsContext2); + } + + WaveFormat2 = (PKSDATAFORMAT_WAVEFORMATEX)Irp->UserBuffer; + WaveFormat->WaveFormatEx.nChannels = WaveFormat2->WaveFormatEx.nChannels; + WaveFormat->WaveFormatEx.nSamplesPerSec = WaveFormat2->WaveFormatEx.nSamplesPerSec; + WaveFormat->WaveFormatEx.wBitsPerSample = WaveFormat2->WaveFormatEx.wBitsPerSample; + + IoStack->FileObject->FsContext2 = (PVOID)WaveFormat; + + + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + } + } + } Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; @@ -179,9 +332,73 @@ PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject) { + PKSPIN_CONNECT ConnectDetails; + PKSSTREAM_HEADER StreamHeader; + PVOID BufferOut; + ULONG BufferLength; + NTSTATUS Status = STATUS_SUCCESS; + LPWSTR PinName = L"{146F1A80-4791-11D0-A5D6-28DB04C10000}\\"; + + PKSDATAFORMAT_WAVEFORMATEX BaseFormat, TransformedFormat; + DPRINT1("Pin_fnFastWrite called DeviceObject %p Irp %p\n", DeviceObject); - return FALSE; + + BaseFormat = (PKSDATAFORMAT_WAVEFORMATEX)FileObject->FsContext2; + if (!BaseFormat) + { + DPRINT1("Expected DataFormat\n"); + DbgBreakPoint(); + IoStatus->Status = STATUS_UNSUCCESSFUL; + IoStatus->Information = 0; + return FALSE; + } + + if (FileObject->FileName.Length < wcslen(PinName) + sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT)) + { + DPRINT1("Expected DataFormat\n"); + DbgBreakPoint(); + IoStatus->Status = STATUS_INVALID_PARAMETER; + IoStatus->Information = 0; + return FALSE; + } + + ConnectDetails = (PKSPIN_CONNECT)(FileObject->FileName.Buffer + wcslen(PinName)); + TransformedFormat = (PKSDATAFORMAT_WAVEFORMATEX)(ConnectDetails + 1); + StreamHeader = (PKSSTREAM_HEADER)Buffer; + + DPRINT1("Num Channels %u Old Channels %u\n SampleRate %u Old SampleRate %u\n BitsPerSample %u Old BitsPerSample %u\n", + BaseFormat->WaveFormatEx.nChannels, TransformedFormat->WaveFormatEx.nChannels, + BaseFormat->WaveFormatEx.nSamplesPerSec, TransformedFormat->WaveFormatEx.nSamplesPerSec, + BaseFormat->WaveFormatEx.wBitsPerSample, TransformedFormat->WaveFormatEx.wBitsPerSample); + + if (BaseFormat->WaveFormatEx.wBitsPerSample != TransformedFormat->WaveFormatEx.wBitsPerSample) + { + Status = PerformQualityConversion(StreamHeader->Data, + StreamHeader->DataUsed, + BaseFormat->WaveFormatEx.wBitsPerSample, + TransformedFormat->WaveFormatEx.wBitsPerSample, + &BufferOut, + &BufferLength); + if (NT_SUCCESS(Status)) + { + DPRINT1("Old BufferSize %u NewBufferSize %u\n", StreamHeader->DataUsed, BufferLength); + ExFreePool(StreamHeader->Data); + StreamHeader->Data = BufferOut; + StreamHeader->DataUsed = BufferLength; + } + } + + if (BaseFormat->WaveFormatEx.nSamplesPerSec != TransformedFormat->WaveFormatEx.nSamplesPerSec) + { + /* sample format conversion must be done in a deferred routine */ + return FALSE; + } + + if (NT_SUCCESS(Status)) + return TRUE; + else + return TRUE; } static KSDISPATCH_TABLE PinTable = Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -21,7 +21,9 @@ const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}; const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}; const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; - +const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; +const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; +const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}; NTSTATUS SetIrpIoStatus( @@ -145,13 +147,18 @@ { NTSTATUS Status; PSYSAUDIO_CLIENT AudioClient; - HANDLE RealPinHandle, VirtualPinHandle; + HANDLE RealPinHandle, VirtualPinHandle, MixerPinHandle = NULL; HANDLE Filter; - ULONG NumHandels; - PFILE_OBJECT FileObject; + ULONG NumHandels, BytesReturned; + PFILE_OBJECT FileObject, MixerFileObject = NULL; PSYSAUDIO_PIN_HANDLE ClientPinHandle; PPIN_WORKER_CONTEXT WorkerContext = (PPIN_WORKER_CONTEXT)Context; + PKSPIN_CONNECT PinConnect = NULL; + KSPROPERTY PinRequest; + PKSDATAFORMAT_WAVEFORMATEX ClientFormat; + Filter = WorkerContext->PinConnect->PinToHandle; + WorkerContext->PinConnect->PinToHandle = NULL; @@ -162,11 +169,78 @@ ASSERT(WorkerContext->Entry->Pins); ASSERT(WorkerContext->Entry->NumberOfPins > WorkerContext->PinConnect->PinId); + PinConnect = WorkerContext->PinConnect; + ClientFormat = (PKSDATAFORMAT_WAVEFORMATEX)(PinConnect + 1); + + if (WorkerContext->CreateMixerPin) + { + PinConnect = ExAllocatePool(NonPagedPool, sizeof(KSPIN_CONNECT) + WorkerContext->MixerFormat->DataFormat.FormatSize); + if (!PinConnect) + { + /* no memory */ + SetIrpIoStatus(WorkerContext->Irp, STATUS_NO_MEMORY, 0); + ExFreePool(WorkerContext->DispatchContext); + ExFreePool(WorkerContext->MixerFormat); + ExFreePool(WorkerContext); + return; + } + + RtlMoveMemory(PinConnect, WorkerContext->PinConnect, sizeof(KSPIN_CONNECT)); + RtlMoveMemory((PinConnect + 1), WorkerContext->MixerFormat, WorkerContext->MixerFormat->DataFormat.FormatSize); + + + Status = KsCreatePin(WorkerContext->DeviceExtension->KMixerHandle, PinConnect, GENERIC_READ | GENERIC_WRITE, &MixerPinHandle); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create Mixer Pin with %x\n", Status); + SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); + ExFreePool(WorkerContext->DispatchContext); + ExFreePool(WorkerContext); + return; + } + + Status = ObReferenceObjectByHandle(MixerPinHandle, + GENERIC_READ | GENERIC_WRITE, + IoFileObjectType, KernelMode, (PVOID*)&MixerFileObject, NULL); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to get file object with %x\n", Status); + SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); + ExFreePool(WorkerContext->DispatchContext); + ExFreePool(WorkerContext); + return; + } + + WorkerContext->DispatchContext->hMixerPin = MixerPinHandle; + WorkerContext->DispatchContext->MixerFileObject = MixerFileObject; + + PinRequest.Set = KSPROPSETID_Connection; + PinRequest.Flags = KSPROPERTY_TYPE_SET; + PinRequest.Id = KSPROPERTY_CONNECTION_DATAFORMAT; + + DPRINT1("ClientFormat %p Channels %u Samples %u Bits %u\n", ClientFormat, ClientFormat->WaveFormatEx.nChannels, ClientFormat->WaveFormatEx.nSamplesPerSec, ClientFormat->WaveFormatEx.wBitsPerSample); + + Status = KsSynchronousIoControlDevice(MixerFileObject, KernelMode, IOCTL_KS_PROPERTY, + (PVOID)&PinRequest, + sizeof(KSPROPERTY), + (PVOID)ClientFormat, + sizeof(KSDATAFORMAT_WAVEFORMATEX), + &BytesReturned); + + } + if (WorkerContext->CreateRealPin) { /* create the real pin */ DPRINT("Creating real pin\n"); - Status = KsCreatePin(WorkerContext->Entry->Handle, WorkerContext->PinConnect, GENERIC_READ | GENERIC_WRITE, &RealPinHandle); + + if (WorkerContext->CreateMixerPin) + Status = KsCreatePin(WorkerContext->Entry->Handle, PinConnect, GENERIC_READ | GENERIC_WRITE, &RealPinHandle); + else + Status = KsCreatePin(WorkerContext->Entry->Handle, WorkerContext->PinConnect, GENERIC_READ | GENERIC_WRITE, &RealPinHandle); + DPRINT1("Status %x\n", Status); if (!NT_SUCCESS(Status)) { @@ -295,12 +369,15 @@ AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].bHandle = TRUE; AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hPin = RealPinHandle; AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].PinId = WorkerContext->PinConnect->PinId; + AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hMixer = MixerPinHandle; + } else { AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].bHandle = FALSE; AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hPin = VirtualPinHandle; AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].PinId = WorkerContext->PinConnect->PinId; + AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hMixer = MixerPinHandle; } /// increase reference count @@ -428,6 +505,7 @@ PinRequest.Property.Id = KSPROPERTY_CONNECTION_DATAFORMAT; PinRequest.PinId = PinConnect->PinId; + /* get pin file object */ Status = ObReferenceObjectByHandle(Entry->Pins[PinConnect->PinId].PinHandle, GENERIC_READ | GENERIC_WRITE, @@ -443,6 +521,13 @@ Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSPROPERTY), (PVOID)(PinConnect + 1), Length, &BytesReturned); ObDereferenceObject(FileObject); + + if (!NT_SUCCESS(Status)) + { + /* set the format on the mixer pin */ + UNIMPLEMENTED + return STATUS_SUCCESS; + } return Status; } @@ -469,6 +554,11 @@ PPIN_WORKER_CONTEXT WorkerContext; PDISPATCH_CONTEXT DispatchContext; ULONG Index, SubIndex; + BOOL CreateMixerPin; + PKSDATARANGE_AUDIO AudioRange; + PKSDATAFORMAT_WAVEFORMATEX MixerFormat = NULL, ClientFormat; + + PKSMULTIPLE_ITEM MultipleItem; IoStack = IoGetCurrentIrpStackLocation(Irp); @@ -522,6 +612,113 @@ return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } + /* check the format */ + PinRequest.PinId = PinConnect->PinId; + PinRequest.Property.Set = KSPROPSETID_Pin; + PinRequest.Property.Flags = KSPROPERTY_TYPE_SET; + PinRequest.Property.Id = KSPROPERTY_PIN_PROPOSEDATAFORMAT; + + CreateMixerPin = FALSE; + BytesReturned = IoStack->Parameters.DeviceIoControl.InputBufferLength - sizeof(KSPIN_CONNECT) - sizeof(SYSAUDIO_INSTANCE_INFO); + if (BytesReturned != sizeof(KSDATAFORMAT_WAVEFORMATEX)) + { + UNIMPLEMENTED + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + ClientFormat = (PKSDATAFORMAT_WAVEFORMATEX)(PinConnect + 1); + + Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)ClientFormat, BytesReturned, &BytesReturned); + if (!NT_SUCCESS(Status)) + { + //DPRINT("Property Request KSPROPERTY_PIN_PROPOSEDATAFORMAT failed with %x\n", Status); + + if (!DeviceExtension->KMixerHandle || !DeviceExtension->KMixerFileObject) + { + DPRINT1("KMixer is not available\n"); + DbgBreakPoint(); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + PinRequest.PinId = PinConnect->PinId; + PinRequest.Property.Set = KSPROPSETID_Pin; + PinRequest.Property.Flags = KSPROPERTY_TYPE_GET; + PinRequest.Property.Id = KSPROPERTY_PIN_DATARANGES; + + Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), NULL, 0, &BytesReturned); + if (Status != STATUS_BUFFER_TOO_SMALL) + { + DPRINT1("Property Request KSPROPERTY_PIN_DATARANGES failed with %x\n", Status); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + MultipleItem = ExAllocatePool(NonPagedPool, BytesReturned); + if (!MultipleItem) + { + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + MixerFormat = ExAllocatePool(NonPagedPool, sizeof(KSDATAFORMAT_WAVEFORMATEX)); + if (!MixerFormat) + { + ExFreePool(MultipleItem); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned, &BytesReturned); + if (!NT_SUCCESS(Status)) + { + DPRINT("Property Request KSPROPERTY_PIN_DATARANGES failed with %x\n", Status); + ExFreePool(MixerFormat); + ExFreePool(MultipleItem); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + CreateMixerPin = FALSE; + AudioRange = (PKSDATARANGE_AUDIO)(MultipleItem + 1); + for(Index = 0; Index < MultipleItem->Count; Index++) + { + if (AudioRange->DataRange.FormatSize != sizeof(KSDATARANGE_AUDIO)) + { + UNIMPLEMENTED + AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize); + } + MixerFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX); + MixerFormat->DataFormat.Flags = 0; + MixerFormat->DataFormat.Reserved = 0; + MixerFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO; + MixerFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + MixerFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; + MixerFormat->DataFormat.SampleSize = 4; + MixerFormat->WaveFormatEx.wFormatTag = ClientFormat->WaveFormatEx.wFormatTag; + MixerFormat->WaveFormatEx.nChannels = min(AudioRange->MaximumChannels, ClientFormat->WaveFormatEx.nChannels); + MixerFormat->WaveFormatEx.nSamplesPerSec = max(AudioRange->MinimumSampleFrequency, min(AudioRange->MaximumSampleFrequency, ClientFormat->WaveFormatEx.nSamplesPerSec)); + MixerFormat->WaveFormatEx.wBitsPerSample = max(AudioRange->MinimumBitsPerSample, min(AudioRange->MaximumBitsPerSample, ClientFormat->WaveFormatEx.wBitsPerSample)); + MixerFormat->WaveFormatEx.cbSize = 0; + MixerFormat->WaveFormatEx.nBlockAlign = (MixerFormat->WaveFormatEx.nChannels * MixerFormat->WaveFormatEx.wBitsPerSample) / 8; + MixerFormat->WaveFormatEx.nAvgBytesPerSec = MixerFormat->WaveFormatEx.nChannels * MixerFormat->WaveFormatEx.nSamplesPerSec * (MixerFormat->WaveFormatEx.wBitsPerSample / 8); + + CreateMixerPin = TRUE; + break; + + AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize); + } + ExFreePool(MultipleItem); + if (!CreateMixerPin) + { + ExFreePool(MixerFormat); + DPRINT1("No Format found :(\n"); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } +#if 0 + DPRINT1("\nNum Channels %u Old Channels %u\n SampleRate %u Old SampleRate %u\n BitsPerSample %u Old BitsPerSample %u\n ClientFormat %p", + MixerFormat->WaveFormatEx.nChannels, ClientFormat->WaveFormatEx.nChannels, + MixerFormat->WaveFormatEx.nSamplesPerSec, ClientFormat->WaveFormatEx.nSamplesPerSec, + MixerFormat->WaveFormatEx.wBitsPerSample, ClientFormat->WaveFormatEx.wBitsPerSample, ClientFormat); +#endif + } + + /* get the instances count */ PinRequest.PinId = PinConnect->PinId; PinRequest.Property.Set = KSPROPSETID_Pin; PinRequest.Property.Flags = KSPROPERTY_TYPE_GET; @@ -531,12 +728,16 @@ if (!NT_SUCCESS(Status)) { DPRINT("Property Request KSPROPERTY_PIN_GLOBALCINSTANCES failed with %x\n", Status); + if (MixerFormat) + ExFreePool(MixerFormat); return SetIrpIoStatus(Irp, Status, 0); } if (PinInstances.PossibleCount == 0) { /* caller wanted to open an instance-less pin */ + if (MixerFormat) + ExFreePool(MixerFormat); return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } @@ -572,6 +773,8 @@ { /* FIXME need ksmixer */ DPRINT1("Device %u Pin %u References %u is already occupied, try later\n", InstanceInfo->DeviceNumber, PinConnect->PinId, Entry->Pins[PinConnect->PinId].References); + if (MixerFormat) + ExFreePool(MixerFormat); return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } } @@ -579,6 +782,8 @@ WorkItem = IoAllocateWorkItem(DeviceObject); if (!WorkItem) { + if (MixerFormat) + ExFreePool(MixerFormat); Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -590,6 +795,8 @@ if (!WorkerContext) { /* invalid parameters */ + if (MixerFormat) + ExFreePool(MixerFormat); IoFreeWorkItem(WorkItem); return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); } @@ -599,6 +806,8 @@ if (!DispatchContext) { /* invalid parameters */ + if (MixerFormat) + ExFreePool(MixerFormat); IoFreeWorkItem(WorkItem); ExFreePool(WorkerContext); return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); @@ -613,6 +822,8 @@ Status = SetPinFormat(Entry, PinConnect, Length); if (!NT_SUCCESS(Status)) { + if (MixerFormat) + ExFreePool(MixerFormat); IoFreeWorkItem(WorkItem); ExFreePool(WorkerContext); ExFreePool(DispatchContext); @@ -632,6 +843,9 @@ WorkerContext->Irp = Irp; WorkerContext->PinConnect = PinConnect; WorkerContext->AudioClient = ClientInfo; + WorkerContext->CreateMixerPin = CreateMixerPin; + WorkerContext->DeviceExtension = DeviceExtension; + WorkerContext->MixerFormat = MixerFormat; DPRINT("Queing Irp %p\n", Irp); /* queue the work item */ Modified: trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -106,8 +106,51 @@ DPRINT1("Num Pins %u Num WaveIn Pins %u Name WaveOut Pins %u\n", DeviceEntry->NumberOfPins, DeviceEntry->NumWaveInPin, DeviceEntry->NumWaveOutPin); } - - +NTSTATUS +OpenDevice( + IN PUNICODE_STRING DeviceName, + IN PHANDLE HandleOut, + IN PFILE_OBJECT * FileObjectOut) +{ + NTSTATUS Status; + HANDLE NodeHandle; + PFILE_OBJECT FileObject; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + + InitializeObjectAttributes(&ObjectAttributes, DeviceName, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, NULL, NULL); + + Status = ZwCreateFile(&NodeHandle, + GENERIC_READ | GENERIC_WRITE, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + 0, + FILE_OPEN, + FILE_SYNCHRONOUS_IO_NONALERT, + NULL, + 0); + + + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwCreateFile failed with %x\n", Status); + return Status; + } + + Status = ObReferenceObjectByHandle(NodeHandle, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + if (!NT_SUCCESS(Status)) + { + ZwClose(NodeHandle); + DPRINT1("ObReferenceObjectByHandle failed with %x\n", Status); + return Status; + } + + *HandleOut = NodeHandle; + *FileObjectOut = FileObject; + return Status; +} NTSTATUS NTAPI @@ -129,11 +172,7 @@ { /* a new device has arrived */ - PFILE_OBJECT FileObject = NULL; PKSAUDIO_DEVICE_ENTRY DeviceEntry; - HANDLE NodeHandle; - IO_STATUS_BLOCK IoStatusBlock; - OBJECT_ATTRIBUTES ObjectAttributes; PIO_WORKITEM WorkItem; DeviceEntry = ExAllocatePool(NonPagedPool, sizeof(KSAUDIO_DEVICE_ENTRY)); @@ -172,21 +211,7 @@ DPRINT1("Sym %wZ\n", &DeviceEntry->DeviceName); - InitializeObjectAttributes(&ObjectAttributes, &DeviceEntry->DeviceName, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, NULL, NULL); - - Status = ZwCreateFile(&NodeHandle, - GENERIC_READ | GENERIC_WRITE, - &ObjectAttributes, - &IoStatusBlock, - NULL, - 0, - 0, - FILE_OPEN, - FILE_SYNCHRONOUS_IO_NONALERT, - NULL, - 0); - - + Status = OpenDevice(&DeviceEntry->DeviceName, &DeviceEntry->Handle, &DeviceEntry->FileObject); if (!NT_SUCCESS(Status)) { DPRINT1("ZwCreateFile failed with %x\n", Status); @@ -194,19 +219,7 @@ return Status; } - Status = ObReferenceObjectByHandle(NodeHandle, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); - if (!NT_SUCCESS(Status)) - { - ZwClose(NodeHandle); - ExFreePool(DeviceEntry); - DPRINT1("ObReferenceObjectByHandle failed with %x\n", Status); - return Status; - } - - DeviceEntry->Handle = NodeHandle; - DeviceEntry->FileObject = FileObject; - - DPRINT1("Successfully opened audio device %u handle %p file object %p device object %p\n", DeviceExtension->KsAudioDeviceList, NodeHandle, FileObject, FileObject->DeviceObject); + DPRINT1("Successfully opened audio device %u handle %p file object %p device object %p\n", DeviceExtension->KsAudioDeviceList, DeviceEntry->Handle, DeviceEntry->FileObject, DeviceEntry->FileObject->DeviceObject); DeviceExtension->NumberOfKsAudioDevices++; WorkItem = IoAllocateWorkItem(DeviceObject); Modified: trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -334,3 +334,27 @@ return Status; } +NTSTATUS +SysAudioOpenKMixer( + IN SYSAUDIODEVEXT *DeviceExtension) +{ + NTSTATUS Status; + + UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\kmixer"); + UNICODE_STRING DevicePath = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\kmixer"); + + Status = ZwLoadDriver(&DevicePath); + + if (NT_SUCCESS(Status)) + { + Status = OpenDevice(&DeviceName, &DeviceExtension->KMixerHandle, &DeviceExtension->KMixerFileObject); + if (!NT_SUCCESS(Status)) + { + DeviceExtension->KMixerHandle = NULL; + DeviceExtension->KMixerFileObject = NULL; + } + } + + DPRINT("Status %lx KMixerHandle %p KMixerFileObject %p\n", Status, DeviceExtension->KMixerHandle, DeviceExtension->KMixerFileObject); + return STATUS_SUCCESS; +} Modified: trunk/reactos/drivers/wdm/audio/sysaudio/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -140,6 +140,13 @@ goto cleanup; } + Status = SysAudioOpenKMixer(DeviceExtension); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SysAudioOpenKMixer failed with %x\n", Status); + goto cleanup; + } + /* set io flags */ DeviceObject->Flags |= DO_DIRECT_IO | DO_POWER_PAGABLE; /* clear initializing flag */ Modified: trunk/reactos/drivers/wdm/audio/sysaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -222,6 +222,18 @@ //DPRINT1("Pin_fnFastWrite called DeviceObject %p Irp %p\n", DeviceObject); Context = (PDISPATCH_CONTEXT)FileObject->FsContext2; + +#if 1 + if (Context->hMixerPin && Context->MixerFileObject) + { + Status = KsStreamIo(Context->MixerFileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, KernelMode); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Mixing stream failed with %lx\n", Status); + return FALSE; + } + } +#endif Status = KsStreamIo(Context->FileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, KernelMode); if (Status == STATUS_SUCCESS) return TRUE; Modified: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -6,6 +6,7 @@ BOOL bHandle; ULONG PinId; HANDLE hPin; + HANDLE hMixer; }SYSAUDIO_PIN_HANDLE, *PSYSAUDIO_PIN_HANDLE; @@ -62,6 +63,10 @@ PVOID KsAudioNotificationEntry; PVOID EchoCancelNotificationEntry; KMUTEX Mutex; + + PFILE_OBJECT KMixerFileObject; + HANDLE KMixerHandle; + }SYSAUDIODEVEXT, *PSYSAUDIODEVEXT; typedef struct @@ -71,16 +76,21 @@ ULONG PinId; PKSAUDIO_DEVICE_ENTRY AudioEntry; + HANDLE hMixerPin; + PFILE_OBJECT MixerFileObject; }DISPATCH_CONTEXT, *PDISPATCH_CONTEXT; typedef struct { PIRP Irp; BOOL CreateRealPin; + BOOL CreateMixerPin; PKSAUDIO_DEVICE_ENTRY Entry; KSPIN_CONNECT * PinConnect; PDISPATCH_CONTEXT DispatchContext; PSYSAUDIO_CLIENT AudioClient; + PSYSAUDIODEVEXT DeviceExtension; + PKSDATAFORMAT_WAVEFORMATEX MixerFormat; }PIN_WORKER_CONTEXT, *PPIN_WORKER_CONTEXT; NTSTATUS @@ -101,6 +111,16 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS +SysAudioOpenKMixer( + IN SYSAUDIODEVEXT *DeviceExtension); + +NTSTATUS +OpenDevice( + IN PUNICODE_STRING DeviceName, + IN PHANDLE HandleOut, + IN PFILE_OBJECT * FileObjectOut); + PKSAUDIO_DEVICE_ENTRY GetListEntry( IN PLIST_ENTRY Head, Modified: trunk/reactos/media/inf/audio.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/audio.inf?rev=39…
============================================================================== --- trunk/reactos/media/inf/audio.inf [iso-8859-1] (original) +++ trunk/reactos/media/inf/audio.inf [iso-8859-1] Wed Mar 11 12:30:33 2009 @@ -34,20 +34,28 @@ wdmaud.sys portcls.sys drmk.sys +kmixer.sys [Audio.CopyFiles.UserMode] wdmaud.drv ksuser.dll [Audio_Inst.NT.Services] -AddService = wdmaud, , wdmaud_Service_Inst -AddService = sysaudio, , sysaudio_Service_Inst +AddService = wdmaud,,wdmaud_Service_Inst +AddService = sysaudio,,sysaudio_Service_Inst +AddService = kmixer,,kmixer_Service_Inst [wdmaud_Service_Inst] ServiceType = 1 StartType = 3 ErrorControl = 0 ServiceBinary = %12%\wdmaud.sys + +[kmixer_Service_Inst] +ServiceType = 1 +StartType = 3 +ErrorControl = 0 +ServiceBinary = %12%\kmixer.sys [sysaudio_Service_Inst] ServiceType = 1
15 years, 9 months
1
0
0
0
[jmorlan] 39945: Fix bug where wcscspn could return non-zero value on an empty string.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Wed Mar 11 06:35:29 2009 New Revision: 39945 URL:
http://svn.reactos.org/svn/reactos?rev=39945&view=rev
Log: Fix bug where wcscspn could return non-zero value on an empty string. Modified: trunk/reactos/lib/sdk/crt/wstring/wcscspn.c Modified: trunk/reactos/lib/sdk/crt/wstring/wcscspn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/wstring/wcscsp…
============================================================================== --- trunk/reactos/lib/sdk/crt/wstring/wcscspn.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/wstring/wcscspn.c [iso-8859-1] Wed Mar 11 06:35:29 2009 @@ -18,7 +18,7 @@ wchar_t *s; wchar_t *t; s=(wchar_t *)str; - do { + while (*s) { t=(wchar_t *)reject; while (*t) { if (*t==*s) @@ -28,6 +28,6 @@ if (*t) break; s++; - } while (*s); + } return s-str; /* nr of wchars */ }
15 years, 9 months
1
0
0
0
[jmorlan] 39944: Give an error message when trying to DEL a file that doesn't exist (Bug 4244). Patch by Victor Martinez <vicmarcal at hotmail.com>.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Wed Mar 11 05:17:53 2009 New Revision: 39944 URL:
http://svn.reactos.org/svn/reactos?rev=39944&view=rev
Log: Give an error message when trying to DEL a file that doesn't exist (Bug 4244). Patch by Victor Martinez <vicmarcal at
hotmail.com
>. Modified: trunk/reactos/base/shell/cmd/del.c Modified: trunk/reactos/base/shell/cmd/del.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/del.c?rev=3…
============================================================================== --- trunk/reactos/base/shell/cmd/del.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/del.c [iso-8859-1] Wed Mar 11 05:17:53 2009 @@ -199,51 +199,50 @@ { do { - bExclusion = FALSE; - - /*if it is going to be excluded by - no need to check attrs*/ - if(*dwFlags & DEL_ATTRIBUTES && !bExclusion) - { - - /*save if file attr check if user doesnt care about that attr anyways*/ - if(dwAttrFlags & ATTR_ARCHIVE && !(f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) + bExclusion = FALSE; + + /*if it is going to be excluded by - no need to check attrs*/ + if(*dwFlags & DEL_ATTRIBUTES && !bExclusion) + { + + /*save if file attr check if user doesnt care about that attr anyways*/ + if(dwAttrFlags & ATTR_ARCHIVE && !(f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) bExclusion = TRUE; - if(dwAttrFlags & ATTR_HIDDEN && !(f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) + if(dwAttrFlags & ATTR_HIDDEN && !(f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) bExclusion = TRUE; - if(dwAttrFlags & ATTR_SYSTEM && !(f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) + if(dwAttrFlags & ATTR_SYSTEM && !(f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) bExclusion = TRUE; - if(dwAttrFlags & ATTR_READ_ONLY && !(f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - bExclusion = TRUE; - if(dwAttrFlags & ATTR_N_ARCHIVE && (f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) - bExclusion = TRUE; - if(dwAttrFlags & ATTR_N_HIDDEN && (f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) - bExclusion = TRUE; - if(dwAttrFlags & ATTR_N_SYSTEM && (f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) - bExclusion = TRUE; - if(dwAttrFlags & ATTR_N_READ_ONLY && (f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - bExclusion = TRUE; - } - - if(bExclusion) + if(dwAttrFlags & ATTR_READ_ONLY && !(f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + bExclusion = TRUE; + if(dwAttrFlags & ATTR_N_ARCHIVE && (f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) + bExclusion = TRUE; + if(dwAttrFlags & ATTR_N_HIDDEN && (f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) + bExclusion = TRUE; + if(dwAttrFlags & ATTR_N_SYSTEM && (f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) + bExclusion = TRUE; + if(dwAttrFlags & ATTR_N_READ_ONLY && (f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + bExclusion = TRUE; + } + if(bExclusion) + continue; + + /* ignore directories */ + if (f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; - /* ignore directories */ - if (f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - continue; - - - _tcscpy (pFilePart, f.cFileName); - - /* We cant delete ourselves */ - if(!_tcscmp (CMDPath,szFullPath)) - continue; - - - TRACE("Full filename: %s\n", debugstr_aw(szFullPath)); - - /* ask for deleting */ - if (*dwFlags & DEL_PROMPT) - { + + _tcscpy (pFilePart, f.cFileName); + + /* We cant delete ourselves */ + if(!_tcscmp (CMDPath,szFullPath)) + continue; + + + TRACE("Full filename: %s\n", debugstr_aw(szFullPath)); + + /* ask for deleting */ + if (*dwFlags & DEL_PROMPT) + { ConErrResPrintf(STRING_DEL_ERROR5, szFullPath); res = FilePromptYN (STRING_DEL_ERROR6); @@ -267,19 +266,19 @@ if(RemoveFile (szFullPath, *dwFlags, &f)) dwFiles++; - else + else { - ErrorMessage (GetLastError(), _T("")); + ErrorMessage (GetLastError(), _T("")); // FindClose(hFile); // return -1; - } + } } while (FindNextFile (hFile, &f)); - FindClose (hFile); - } + FindClose (hFile); + } + else error_sfile_not_found(szFullPath); return dwFiles; } - static DWORD ProcessDirectory(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags)
15 years, 9 months
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
49
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Results per page:
10
25
50
100
200