Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITADataSources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
ff03d105
Commit
ff03d105
authored
May 26, 2017
by
Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making WINNT define tentative and style
parent
b3f9d3d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
47 deletions
+46
-47
src/ITADataSourceUtils.cpp
src/ITADataSourceUtils.cpp
+2
-0
tests/ITAAsioTests/ThreadInit.cpp
tests/ITAAsioTests/ThreadInit.cpp
+44
-47
No files found.
src/ITADataSourceUtils.cpp
View file @
ff03d105
...
...
@@ -2,7 +2,9 @@
// Wichtig: Folgendes Makro definiert Windows-NT als Umgebung und
// bewirkt somit die Nutzbarkeit der WaitableTimer.
#ifndef _WIN32_WINNT // @todo: remove
#define _WIN32_WINNT 0x0500
#endif
#include <ITADataSource.h>
#include <ITAStreamInfo.h>
...
...
tests/ITAAsioTests/ThreadInit.cpp
View file @
ff03d105
/*
+------------------------------------------------------------+
| |
| ThreadInit.cpp |
| |
| Testprogramm aus der Testsuite des ITAsioInterface |
| |
| Beschreibung: Test zur ASIO-Initialisierung |
| in Threads |
| |
| Author: Frank Wefers |
| Letzte nderung: 13.04.2011 [stienen] |
| |
| (c) Copyright Institut fr technische Akustik (ITA) |
| Aachen university of technology (RWTH), 2011 |
| |
+------------------------------------------------------------+
*/
// $Id: ThreadInit.cpp 1801 2011-04-13 14:07:25Z stienen $
#include <ITAAsioInterface.h>
#include <process.h>
#include <stdio.h>
#include <string>
#define _WIN32_WINNT 0x0500
#ifndef _WIN32_WINNT // @todo: remove
#define _WIN32_WINNT 0x0500
#endif
#include <windows.h>
int
test
(
const
char
*
pszDriverName
)
{
int
test
(
const
char
*
pszDriverName
)
{
ITAsioInitializeLibrary
();
// Treiber anzeigen
long
lDrivers
=
ITAsioGetNumDrivers
();
if
(
lDrivers
>
0
)
{
printf
(
"Folgende ASIO-Treiber wurden gefunden:
\n\n
"
);
for
(
long
i
=
0
;
i
<
lDrivers
;
i
++
)
{
printf
(
"
\t
[%d]
\t
%s
\n
"
,
i
+
1
,
ITAsioGetDriverName
(
i
));
if
(
lDrivers
>
0
)
{
printf
(
"Folgende ASIO-Treiber wurden gefunden:
\n\n
"
);
for
(
long
i
=
0
;
i
<
lDrivers
;
i
++
)
{
printf
(
"
\t
[%d]
\t
%s
\n
"
,
i
+
1
,
ITAsioGetDriverName
(
i
)
);
}
}
else
{
printf
(
"Keine ASIO-Treiber gefunden!
\n
"
);
}
else
{
printf
(
"Keine ASIO-Treiber gefunden!
\n
"
);
return
0
;
}
;
}
// Treiber initialisieren
printf
(
"Initialisiere Treiber
\"
%s
\"\n
"
,
pszDriverName
);
printf
(
"Initialisiere Treiber
\"
%s
\"\n
"
,
pszDriverName
);
ASIOError
ae
=
ITAsioInitializeDriver
(
pszDriverName
);
if
(
ae
==
ASE_OK
)
{
printf
(
"Initialisierung erfolgreich!"
);
if
(
ae
==
ASE_OK
)
{
printf
(
"Initialisierung erfolgreich!"
);
ITAsioFinalizeDriver
();
}
else
{
printf
(
"Initialisierung fehlgeschlagen (errorcode %d: %s)
\n
"
,
ae
,
ITAsioGetErrorStr
(
ae
));
}
else
{
printf
(
"Initialisierung fehlgeschlagen (errorcode %d: %s)
\n
"
,
ae
,
ITAsioGetErrorStr
(
ae
)
);
return
-
1
;
}
...
...
@@ -59,36 +49,43 @@ int test(const char* pszDriverName) {
return
0
;
}
void
ThreadProc
(
void
*
pParam
)
{
printf
(
"Thread ist gestartet!
\n
"
);
void
ThreadProc
(
void
*
pParam
)
{
printf
(
"Thread ist gestartet!
\n
"
);
// COM initialisieren (Appartment)
//CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if
(
test
((
const
char
*
)
pParam
)
!=
0
)
{
if
(
test
(
(
const
char
*
)
pParam
)
!=
0
)
{
//CoUninitialize();
}
_endthread
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
// COM initialisieren (Appartment)
//CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"Syntax: ThreadInit TREIBERNUMMER
\n
"
);
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"Syntax: ThreadInit TREIBERNUMMER
\n
"
);
return
255
;
}
bool
bThreaded
=
true
;
if
(
bThreaded
)
{
HANDLE
hThread
=
(
HANDLE
)
_beginthread
(
ThreadProc
,
0
,
argv
[
1
]
);
WaitForSingleObject
(
hThread
,
INFINITE
);
}
else
test
(
argv
[
1
]);
if
(
bThreaded
)
{
HANDLE
hThread
=
(
HANDLE
)
_beginthread
(
ThreadProc
,
0
,
argv
[
1
]
);
WaitForSingleObject
(
hThread
,
INFINITE
);
}
else
{
test
(
argv
[
1
]
);
}
//CoUninitialize();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment