Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ITADataSources
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
ff03d105
Commit
ff03d105
authored
May 26, 2017
by
Jonas Stienen
Browse files
Options
Downloads
Patches
Plain Diff
Making WINNT define tentative and style
parent
b3f9d3d1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ITADataSourceUtils.cpp
+2
-0
2 additions, 0 deletions
src/ITADataSourceUtils.cpp
tests/ITAAsioTests/ThreadInit.cpp
+44
-47
44 additions, 47 deletions
tests/ITAAsioTests/ThreadInit.cpp
with
46 additions
and
47 deletions
src/ITADataSourceUtils.cpp
+
2
−
0
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>
...
...
This diff is collapsed.
Click to expand it.
tests/ITAAsioTests/ThreadInit.cpp
+
44
−
47
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>
#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
)
{
if
(
lDrivers
>
0
)
{
printf
(
"Folgende ASIO-Treiber wurden gefunden:
\n\n
"
);
for
(
long
i
=
0
;
i
<
lDrivers
;
i
++
)
{
for
(
long
i
=
0
;
i
<
lDrivers
;
i
++
)
{
printf
(
"
\t
[%d]
\t
%s
\n
"
,
i
+
1
,
ITAsioGetDriverName
(
i
)
);
}
}
else
{
}
else
{
printf
(
"Keine ASIO-Treiber gefunden!
\n
"
);
return
0
;
}
;
}
// Treiber initialisieren
printf
(
"Initialisiere Treiber
\"
%s
\"\n
"
,
pszDriverName
);
ASIOError
ae
=
ITAsioInitializeDriver
(
pszDriverName
);
if
(
ae
==
ASE_OK
)
{
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,25 +49,29 @@ int test(const char* pszDriverName) {
return
0
;
}
void
ThreadProc
(
void
*
pParam
)
{
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
)
{
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"Syntax: ThreadInit TREIBERNUMMER
\n
"
);
return
255
;
}
...
...
@@ -87,8 +81,11 @@ int main(int argc, char* argv[]) {
if
(
bThreaded
)
{
HANDLE
hThread
=
(
HANDLE
)
_beginthread
(
ThreadProc
,
0
,
argv
[
1
]
);
WaitForSingleObject
(
hThread
,
INFINITE
);
}
else
}
else
{
test
(
argv
[
1
]
);
}
//CoUninitialize();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment