1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     midi_Result.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46347 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_MIDI_MIDI_RESULT_H_
17 #define NN_MIDI_MIDI_RESULT_H_
18 
19 #ifdef __cplusplus
20 
21 #include <nn/Result.h>
22 
23 namespace nn {
24 namespace midi {
25 
26 enum Description
27 {
28     DESCRIPTION_ALREADY_OPENED = 1,
29     DESCRIPTION_NOT_OPENED,
30     DESCRIPTION_BUFFER_OVERFLOW,
31     DESCRIPTION_DEVICE_FIFO_FULL,
32     DESCRIPTION_DEVICE_FRAME_ERROR,
33     DESCRIPTION_DEVICE_INVALID_DATA_LENGTH,
34     DESCRIPTION_UNKNOWN_DEVICE
35 };
36 
37 NN_DEFINE_RESULT_FUNC_LM(MakeUsageResult, Result::LEVEL_USAGE, Result::MODULE_NN_MIDI);
38 NN_DEFINE_RESULT_FUNC_LSM(MakeDeviceFatalResult, Result::LEVEL_FATAL, Result::SUMMARY_INVALID_STATE, Result::MODULE_NN_MIDI);
39 
40 NN_DEFINE_RESULT_CONST(
41     ResultNotImplemented,
42     Result::LEVEL_FATAL, Result::SUMMARY_NOT_SUPPORTED, Result::MODULE_NN_MIDI, nn::Result::DESCRIPTION_NOT_IMPLEMENTED
43 );
44 
45 NN_DEFINE_RESULT_CONST_LM(
46     ResultAlreadyOpened,
47     MakeUsageResult, Result::SUMMARY_INVALID_STATE, DESCRIPTION_ALREADY_OPENED
48 );
49 
50 NN_DEFINE_RESULT_CONST_LM(
51     ResultNotOpened,
52     MakeUsageResult, Result::SUMMARY_INVALID_STATE, DESCRIPTION_NOT_OPENED
53 );
54 
55 NN_DEFINE_RESULT_CONST_LM(
56     ResultBufferOverflow,
57     MakeUsageResult, Result::SUMMARY_INVALID_STATE, DESCRIPTION_BUFFER_OVERFLOW
58 );
59 
60 NN_DEFINE_RESULT_CONST_LSM(
61     ResultDeviceFifoFull,
62     MakeDeviceFatalResult, DESCRIPTION_DEVICE_FIFO_FULL
63 );
64 
65 NN_DEFINE_RESULT_CONST_LSM(
66     ResultDeviceFrameError,
67     MakeDeviceFatalResult, DESCRIPTION_DEVICE_FRAME_ERROR
68 );
69 
70 NN_DEFINE_RESULT_CONST_LSM(
71     ResultDeviceInvalidDataLength,
72     MakeDeviceFatalResult, DESCRIPTION_DEVICE_INVALID_DATA_LENGTH
73 );
74 
75 NN_DEFINE_RESULT_CONST_LSM(
76     ResultUnknownDevice,
77     MakeDeviceFatalResult, DESCRIPTION_UNKNOWN_DEVICE
78 );
79 
80 } // end of namespace fs
81 } // end of namespace nn
82 
83 #endif // #ifdef __cplusplus
84 #endif // #ifndef NN_MIDI_MIDI_RESULT_H_
85