1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     midi_Result.h
4 
5   Copyright (C)2009 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: 16865 $
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,
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 };
35 
36 NN_DEFINE_RESULT_FUNC_LM(MakeUsageResult, Result::LEVEL_USAGE, Result::MODULE_NN_MIDI);
37 NN_DEFINE_RESULT_FUNC_LSM(MakeDeviceFatalResult, Result::LEVEL_FATAL, Result::SUMMARY_INVALID_STATE, Result::MODULE_NN_MIDI);
38 
39 NN_DEFINE_RESULT_CONST(
40     ResultNotImplemented,
41     Result::LEVEL_FATAL, Result::SUMMARY_NOT_SUPPORTED, Result::MODULE_NN_MIDI, nn::Result::DESCRIPTION_NOT_IMPLEMENTED
42 );
43 
44 NN_DEFINE_RESULT_CONST_LM(
45     ResultAlreadyOpened,
46     MakeUsageResult, Result::SUMMARY_INVALID_STATE, DESCRIPTION_ALREADY_OPENED
47 );
48 
49 NN_DEFINE_RESULT_CONST_LM(
50     ResultNotOpened,
51     MakeUsageResult, Result::SUMMARY_INVALID_STATE, DESCRIPTION_NOT_OPENED
52 );
53 
54 NN_DEFINE_RESULT_CONST_LM(
55     ResultBufferOverflow,
56     MakeUsageResult, Result::SUMMARY_INVALID_STATE, DESCRIPTION_BUFFER_OVERFLOW
57 );
58 
59 NN_DEFINE_RESULT_CONST_LSM(
60     ResultDeviceFifoFull,
61     MakeDeviceFatalResult, DESCRIPTION_DEVICE_FIFO_FULL
62 );
63 
64 NN_DEFINE_RESULT_CONST_LSM(
65     ResultDeviceFrameError,
66     MakeDeviceFatalResult, DESCRIPTION_DEVICE_FRAME_ERROR
67 );
68 
69 NN_DEFINE_RESULT_CONST_LSM(
70     ResultDeviceInvalidDataLength,
71     MakeDeviceFatalResult, DESCRIPTION_DEVICE_INVALID_DATA_LENGTH
72 );
73 
74 } // end of namespace fs
75 } // end of namespace nn
76 
77 #endif // #ifdef __cplusplus
78 #endif // #ifndef NN_MIDI_MIDI_RESULT_H_
79